@Test public void testAcceptDirectoryExists() throws Exception { final HashMap<Path, Path> files = new HashMap<Path, Path>(); final Path source = new Path("a", EnumSet.of(Path.Type.directory)); files.put(source, new Path("a", EnumSet.of(Path.Type.directory))); final Find find = new Find() { @Override public boolean find(final Path file) { return true; } }; AbstractCopyFilter f = new OverwriteFilter(new NullTransferSession(new Host(new TestProtocol())), new NullTransferSession(new Host(new TestProtocol())) { @Override @SuppressWarnings("unchecked") public <T> T _getFeature(final Class<T> type) { if(type.equals(Find.class)) { return (T) find; } return super._getFeature(type); } }, files); assertTrue(f.accept(source, null, new TransferStatus().exists(true))); final TransferStatus status = f.prepare(source, null, new TransferStatus().exists(true), new DisabledProgressListener()); assertTrue(status.isExists()); }
@Override public boolean accept(final Path source, final Local local, final TransferStatus parent) { return true; }
OverwriteFilter extends AbstractCopyFilter { @Override public boolean accept(final Path source, final Local local, final TransferStatus parent) { return true; } }
OverwriteFilter extends AbstractCopyFilter { @Override public boolean accept(final Path source, final Local local, final TransferStatus parent) { return true; } OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files);  OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files, final UploadFilterOptions options); }
OverwriteFilter extends AbstractCopyFilter { @Override public boolean accept(final Path source, final Local local, final TransferStatus parent) { return true; } OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files);  OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files, final UploadFilterOptions options); @Override boolean accept(final Path source, final Local local, final TransferStatus parent); }
OverwriteFilter extends AbstractCopyFilter { @Override public boolean accept(final Path source, final Local local, final TransferStatus parent) { return true; } OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files);  OverwriteFilter(final Session<?> source, final Session<?> destination, final Map<Path, Path> files, final UploadFilterOptions options); @Override boolean accept(final Path source, final Local local, final TransferStatus parent);  }