@Test public void testAccept() throws Exception { SkipFilter f = new SkipFilter(new DisabledUploadSymlinkResolver(), new NullTransferSession(new Host(new TestProtocol())) { @Override @SuppressWarnings("unchecked") public <T> T _getFeature(Class<T> type) { if(type == Find.class) { return (T) new Find() { @Override public boolean find(Path file) { return true; } }; } return super._getFeature(type); } }); assertFalse(f.accept(new Path("a", EnumSet.of(Path.Type.file)), new NullLocal("a") { @Override public boolean exists() { return true; } }, new TransferStatus().exists(true))); }
@Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(parent.isExists()) { if(local.isFile()) { if(find.withCache(cache).find(file)) { if(log.isInfoEnabled()) { log.info(String.format("Skip file %s", file)); } return false; } } } return super.accept(file, local, parent); }
SkipFilter extends AbstractUploadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(parent.isExists()) { if(local.isFile()) { if(find.withCache(cache).find(file)) { if(log.isInfoEnabled()) { log.info(String.format("Skip file %s", file)); } return false; } } } return super.accept(file, local, parent); } }
SkipFilter extends AbstractUploadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(parent.isExists()) { if(local.isFile()) { if(find.withCache(cache).find(file)) { if(log.isInfoEnabled()) { log.info(String.format("Skip file %s", file)); } return false; } } } return super.accept(file, local, parent); } SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                      final UploadFilterOptions options); }
SkipFilter extends AbstractUploadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(parent.isExists()) { if(local.isFile()) { if(find.withCache(cache).find(file)) { if(log.isInfoEnabled()) { log.info(String.format("Skip file %s", file)); } return false; } } } return super.accept(file, local, parent); } SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                      final UploadFilterOptions options); @Override boolean accept(final Path file, final Local local, final TransferStatus parent); }
SkipFilter extends AbstractUploadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(parent.isExists()) { if(local.isFile()) { if(find.withCache(cache).find(file)) { if(log.isInfoEnabled()) { log.info(String.format("Skip file %s", file)); } return false; } } } return super.accept(file, local, parent); } SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session);  SkipFilter(final SymlinkResolver<Local> symlinkResolver, final Session<?> session,
                      final UploadFilterOptions options); @Override boolean accept(final Path file, final Local local, final TransferStatus parent);  }