@Override public Map<String, String> getMetadata(final Path file) throws BackgroundException { return new B2AttributesFinderFeature(session, fileid).find(file).getMetadata(); }
for(Path next : files) { if(Collections.<String, String>emptyMap() == next.attributes().getMetadata()) { final Map<String, String> metadata = feature.getMetadata(next); next.attributes().setMetadata(metadata); for(Map.Entry<String, String> entry : next.attributes().getMetadata().entrySet()) { if(graphMetadata.containsKey(entry.getKey())) {
@Override public Map<String, String> getMetadata(final Path file) throws BackgroundException { if(file.isFile() || file.isPlaceholder()) { try { return new S3AttributesFinderFeature(session).find(file).getMetadata(); } catch(NotfoundException e) { if(file.isPlaceholder()) { // No placeholder file may exist but we just have a common prefix return Collections.emptyMap(); } throw e; } } return Collections.emptyMap(); }
protected void write(final Session<?> session, final Metadata feature, final Path file) throws BackgroundException { if(this.isCanceled()) { throw new ConnectionCanceledException(); } // Read online metadata (storing non-edited metadata entries) final Map<String, String> update = new HashMap<>(file.attributes().getMetadata()); // Purge removed entries update.entrySet().removeIf(entry -> !metadata.containsKey(entry.getKey())); // iterate all metadata entries and for(Map.Entry<String, String> entry : metadata.entrySet()) { // check if update is non-null (should not) && entry value is not null if(entry.getValue() != null) { // update update.put(entry.getKey(), entry.getValue()); } } // If anything has changed save metadata, otherwise continue and do for everything underneath this directory if(!update.equals(file.attributes().getMetadata())) { listener.message(MessageFormat.format(LocaleFactory.localizedString("Writing metadata of {0}", "Status"), file.getName())); feature.setMetadata(file, update); } if(file.isDirectory()) { if(callback.recurse(file, LocaleFactory.localizedString("Metadata", "Info"))) { for(Path child : session.getFeature(ListService.class).list(file, new WorkerListProgressListener(this, listener))) { this.write(session, feature, child); } } } }
try { if(containerService.isContainer(file)) { for(Map.Entry<String, String> entry : file.attributes().getMetadata().entrySet()) {