@Test public void testTemporaryDisabledLargeUpload() throws Exception { final Host h = new Host(new TestProtocol()); final NullSession session = new NullSession(h); final AbstractUploadFilter f = new UploadTransfer(h, Collections.emptyList()) .filter(session, null, TransferAction.overwrite, new DisabledProgressListener()); final Path file = new Path("/t", EnumSet.of(Path.Type.file)); final TransferStatus status = f.prepare(file, new NullLocal("t"), new TransferStatus(), new DisabledProgressListener()); assertNull(status.getRename().local); assertNull(status.getRename().remote); }
@Override public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) { if(log.isDebugEnabled()) { log.debug(String.format("Filter transfer with action %s and options %s", action, options)); } final Symlink symlink = source.getFeature(Symlink.class); final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots); if(options.temporary) { options.withTemporary(source.getFeature(Write.class).temporary()); } if(action.equals(TransferAction.resume)) { return new ResumeFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.rename)) { return new RenameFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.renameexisting)) { return new RenameExistingFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.skip)) { return new SkipFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.comparison)) { return new CompareFilter(resolver, source, options, listener).withCache(cache); } return new OverwriteFilter(resolver, source, options).withCache(cache); }
UploadTransfer extends Transfer { @Override public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) { if(log.isDebugEnabled()) { log.debug(String.format("Filter transfer with action %s and options %s", action, options)); } final Symlink symlink = source.getFeature(Symlink.class); final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots); if(options.temporary) { options.withTemporary(source.getFeature(Write.class).temporary()); } if(action.equals(TransferAction.resume)) { return new ResumeFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.rename)) { return new RenameFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.renameexisting)) { return new RenameExistingFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.skip)) { return new SkipFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.comparison)) { return new CompareFilter(resolver, source, options, listener).withCache(cache); } return new OverwriteFilter(resolver, source, options).withCache(cache); } }
UploadTransfer extends Transfer { @Override public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) { if(log.isDebugEnabled()) { log.debug(String.format("Filter transfer with action %s and options %s", action, options)); } final Symlink symlink = source.getFeature(Symlink.class); final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots); if(options.temporary) { options.withTemporary(source.getFeature(Write.class).temporary()); } if(action.equals(TransferAction.resume)) { return new ResumeFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.rename)) { return new RenameFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.renameexisting)) { return new RenameExistingFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.skip)) { return new SkipFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.comparison)) { return new CompareFilter(resolver, source, options, listener).withCache(cache); } return new OverwriteFilter(resolver, source, options).withCache(cache); } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); }
UploadTransfer extends Transfer { @Override public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) { if(log.isDebugEnabled()) { log.debug(String.format("Filter transfer with action %s and options %s", action, options)); } final Symlink symlink = source.getFeature(Symlink.class); final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots); if(options.temporary) { options.withTemporary(source.getFeature(Write.class).temporary()); } if(action.equals(TransferAction.resume)) { return new ResumeFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.rename)) { return new RenameFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.renameexisting)) { return new RenameExistingFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.skip)) { return new SkipFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.comparison)) { return new CompareFilter(resolver, source, options, listener).withCache(cache); } return new OverwriteFilter(resolver, source, options).withCache(cache); } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); @Override Transfer withCache(final Cache<Path> cache); Transfer withOptions(final UploadFilterOptions options); @Override Type getType(); @Override List<TransferItem> list(final Session<?> session, final Path remote,
                                   final Local directory, final ListProgressListener listener); @Override AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override void pre(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void post(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void transfer(final Session<?> source, final Session<?> destination, final Path file, final Local local, final TransferOptions options,
                         final TransferStatus status, final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize(); @Override void stop(); }
UploadTransfer extends Transfer { @Override public AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener) { if(log.isDebugEnabled()) { log.debug(String.format("Filter transfer with action %s and options %s", action, options)); } final Symlink symlink = source.getFeature(Symlink.class); final UploadSymlinkResolver resolver = new UploadSymlinkResolver(symlink, roots); if(options.temporary) { options.withTemporary(source.getFeature(Write.class).temporary()); } if(action.equals(TransferAction.resume)) { return new ResumeFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.rename)) { return new RenameFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.renameexisting)) { return new RenameExistingFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.skip)) { return new SkipFilter(resolver, source, options).withCache(cache); } if(action.equals(TransferAction.comparison)) { return new CompareFilter(resolver, source, options, listener).withCache(cache); } return new OverwriteFilter(resolver, source, options).withCache(cache); } UploadTransfer(final Host host, final Path root, final Local local);  UploadTransfer(final Host host, final Path root, final Local local, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f);  UploadTransfer(final Host host, final List<TransferItem> roots, final Filter<Local> f, final Comparator<Local> comparator); @Override Transfer withCache(final Cache<Path> cache); Transfer withOptions(final UploadFilterOptions options); @Override Type getType(); @Override List<TransferItem> list(final Session<?> session, final Path remote,
                                   final Local directory, final ListProgressListener listener); @Override AbstractUploadFilter filter(final Session<?> source, final Session<?> destination, final TransferAction action, final ProgressListener listener); @Override TransferAction action(final Session<?> source, final Session<?> destination, final boolean resumeRequested, final boolean reloadRequested,
                                 final TransferPrompt prompt, final ListProgressListener listener); @Override void pre(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void post(final Session<?> source, final Session<?> destination, final Map<TransferItem, TransferStatus> files, final ConnectionCallback callback); @Override void transfer(final Session<?> source, final Session<?> destination, final Path file, final Local local, final TransferOptions options,
                         final TransferStatus status, final ConnectionCallback connectionCallback,
                         final ProgressListener listener, final StreamListener streamListener); @Override void normalize(); @Override void stop();  }