@Override public R pre(final Transfer.Type type, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback) throws BackgroundException { for(Map.Entry<TransferItem, TransferStatus> file : files.entrySet()) { registry.find(session, file.getKey().remote).getFeature(session, Bulk.class, proxy).pre(type, Collections.singletonMap(file.getKey(), file.getValue()), callback); } return proxy.pre(type, files, callback); }
@Override @SuppressWarnings("unchecked") public T lock(final Path file) throws BackgroundException { return (T) registry.find(session, file).getFeature(session, Lock.class, proxy).lock(file); }
@Override @SuppressWarnings("unchecked") public Output upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { return (Output) registry.find(session, file).getFeature(session, Upload.class, proxy).upload(file, local, throttle, listener, status, callback); }
@Override public boolean isRevertable(final Path file) { try { return registry.find(session, file).getFeature(session, Versioning.class, proxy).isRevertable(file); } catch(VaultUnlockCancelException e) { return false; } }
@Override @SuppressWarnings("unchecked") public void unlock(final Path file, final T token) throws BackgroundException { registry.find(session, file).getFeature(session, Lock.class, proxy).unlock(file, token); }
@Override public void configure(final boolean enable, final Path file) throws BackgroundException { registry.find(session, file).getFeature(session, TransferAcceleration.class, proxy).configure(enable, file); }
@Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { return registry.find(session, folder).getFeature(session, Directory.class, proxy).mkdir(folder, region, status); }
@Override public void setConfiguration(final Path container, final PasswordCallback prompt, final VersioningConfiguration configuration) throws BackgroundException { registry.find(session, container).getFeature(session, Versioning.class, proxy).setConfiguration(container, prompt, configuration); }
@Override public Append append(final Path file, final Long length, final Cache<Path> cache) throws BackgroundException { return registry.find(session, file).getFeature(session, Write.class, proxy).append(file, length, cache); }
@Override public LifecycleConfiguration getConfiguration(final Path container) throws BackgroundException { return registry.find(session, container).getFeature(session, Lifecycle.class, proxy).getConfiguration(container); }
@Override public void setEncryption(final Path file, final Algorithm algorithm) throws BackgroundException { registry.find(session, file).getFeature(session, Encryption.class, proxy).setEncryption(file, algorithm); }
@Override public Algorithm getDefault(final Path file) throws BackgroundException { return registry.find(session, file).getFeature(session, Encryption.class, proxy).getDefault(file); }
@Override public void setPermission(final Path file, final Acl acl) throws BackgroundException { registry.find(session, file).getFeature(session, AclPermission.class, proxy).setPermission(file, acl); }
@Override public LoggingConfiguration getConfiguration(final Path container) throws BackgroundException { return registry.find(session, container).getFeature(session, Logging.class, proxy).getConfiguration(container); }
@Override public void setUnixOwner(final Path file, final String owner) throws BackgroundException { registry.find(session, file).getFeature(session, UnixPermission.class, proxy).setUnixOwner(file, owner); }
@Override public void setUnixPermission(final Path file, final Permission permission) throws BackgroundException { registry.find(session, file).getFeature(session, UnixPermission.class, proxy).setUnixPermission(file, permission); }
@Override public VersioningConfiguration getConfiguration(final Path container) throws BackgroundException { return registry.find(session, container).getFeature(session, Versioning.class, proxy).getConfiguration(container); }
@Override public PathAttributes find(final Path file) throws BackgroundException { return registry.find(session, file).getFeature(session, AttributesFinder.class, proxy) .withCache(cache) .find(file); }
@Override public ChecksumCompute checksum(final Path file) { try { return registry.find(session, file).getFeature(session, Write.class, proxy).checksum(file); } catch(VaultUnlockCancelException e) { return proxy.checksum(file); } }
@Override public AttributedList<Path> search(final Path workdir, final Filter<Path> regex, final ListProgressListener listener) throws BackgroundException { return registry.find(session, workdir).getFeature(session, Search.class, proxy) .withCache(cache) .search(workdir, regex, listener); }