@Test public void testAcceptEqual() throws Exception { final CompareFilter filter = new CompareFilter(new DisabledDownloadSymlinkResolver(), new NullSession(new Host(new TestProtocol())), new DownloadFilterOptions(), new ComparisonServiceFilter( new NullSession(new Host(new TestProtocol())), null, new DisabledProgressListener()) { @Override public Comparison compare(final Path file, final Local local) { return Comparison.equal; } } ); final Path file = new Path("/f", EnumSet.of(Path.Type.file)); final Local local = new NullLocal(System.getProperty("java.io.tmpdir"), "f"); assertFalse(filter.accept(file, local, new TransferStatus().exists(true))); }
@Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(super.accept(file, local, parent)) { final Comparison comparison = comparisonService.compare(file, local); switch(comparison) { case local: if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case equal: if(file.isDirectory()) { return true; } if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case remote: return true; } log.warn(String.format("Invalid comparison result %s", comparison)); } return false; }
CompareFilter extends AbstractDownloadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(super.accept(file, local, parent)) { final Comparison comparison = comparisonService.compare(file, local); switch(comparison) { case local: if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case equal: if(file.isDirectory()) { return true; } if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case remote: return true; } log.warn(String.format("Invalid comparison result %s", comparison)); } return false; } }
CompareFilter extends AbstractDownloadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(super.accept(file, local, parent)) { final Comparison comparison = comparisonService.compare(file, local); switch(comparison) { case local: if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case equal: if(file.isDirectory()) { return true; } if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case remote: return true; } log.warn(String.format("Invalid comparison result %s", comparison)); } return false; } CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session, final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ComparisonServiceFilter comparisonService); }
CompareFilter extends AbstractDownloadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(super.accept(file, local, parent)) { final Comparison comparison = comparisonService.compare(file, local); switch(comparison) { case local: if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case equal: if(file.isDirectory()) { return true; } if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case remote: return true; } log.warn(String.format("Invalid comparison result %s", comparison)); } return false; } CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session, final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ComparisonServiceFilter comparisonService); @Override AbstractDownloadFilter withCache(final Cache<Path> cache); @Override boolean accept(final Path file, final Local local, final TransferStatus parent); }
CompareFilter extends AbstractDownloadFilter { @Override public boolean accept(final Path file, final Local local, final TransferStatus parent) throws BackgroundException { if(super.accept(file, local, parent)) { final Comparison comparison = comparisonService.compare(file, local); switch(comparison) { case local: if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case equal: if(file.isDirectory()) { return true; } if(log.isInfoEnabled()) { log.info(String.format("Skip file %s with comparison %s", file, comparison)); } return false; case remote: return true; } log.warn(String.format("Invalid comparison result %s", comparison)); } return false; } CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session, final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ProgressListener listener);  CompareFilter(final SymlinkResolver<Path> symlinkResolver, final Session<?> session,
                         final DownloadFilterOptions options,
                         final ComparisonServiceFilter comparisonService); @Override AbstractDownloadFilter withCache(final Cache<Path> cache); @Override boolean accept(final Path file, final Local local, final TransferStatus parent);  }