Search in sources :

Example 1 with ComparePathFilter

use of ch.cyberduck.core.synchronization.ComparePathFilter in project cyberduck by iterate-ch.

the class SynchronizationPathFilterTest method testAcceptDirectory.

@Test
public void testAcceptDirectory() throws Exception {
    Session session = new NullSession(new Host(new TestProtocol()));
    final SynchronizationPathFilter mirror = new SynchronizationPathFilter(new ComparePathFilter() {

        @Override
        public Comparison compare(Path file, Local local, final ProgressListener listener) {
            return Comparison.equal;
        }
    }, new OverwriteFilter(new DownloadSymlinkResolver(Collections.<TransferItem>emptyList()), session), new ch.cyberduck.core.transfer.upload.OverwriteFilter(new UploadSymlinkResolver(null, Collections.<TransferItem>emptyList()), session), TransferAction.mirror);
    assertTrue(mirror.accept(new Path("/p", EnumSet.of(Path.Type.directory)), null, new TransferStatus().exists(true)));
}
Also used : Path(ch.cyberduck.core.Path) ComparePathFilter(ch.cyberduck.core.synchronization.ComparePathFilter) DefaultComparePathFilter(ch.cyberduck.core.synchronization.DefaultComparePathFilter) TestProtocol(ch.cyberduck.core.TestProtocol) NullSession(ch.cyberduck.core.NullSession) NullLocal(ch.cyberduck.core.NullLocal) Local(ch.cyberduck.core.Local) Host(ch.cyberduck.core.Host) DownloadSymlinkResolver(ch.cyberduck.core.transfer.symlink.DownloadSymlinkResolver) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) ProgressListener(ch.cyberduck.core.ProgressListener) Comparison(ch.cyberduck.core.synchronization.Comparison) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) UploadSymlinkResolver(ch.cyberduck.core.transfer.symlink.UploadSymlinkResolver) OverwriteFilter(ch.cyberduck.core.transfer.download.OverwriteFilter) NullSession(ch.cyberduck.core.NullSession) Session(ch.cyberduck.core.Session) Test(org.junit.Test)

Aggregations

DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)1 Host (ch.cyberduck.core.Host)1 Local (ch.cyberduck.core.Local)1 NullLocal (ch.cyberduck.core.NullLocal)1 NullSession (ch.cyberduck.core.NullSession)1 Path (ch.cyberduck.core.Path)1 ProgressListener (ch.cyberduck.core.ProgressListener)1 Session (ch.cyberduck.core.Session)1 TestProtocol (ch.cyberduck.core.TestProtocol)1 ComparePathFilter (ch.cyberduck.core.synchronization.ComparePathFilter)1 Comparison (ch.cyberduck.core.synchronization.Comparison)1 DefaultComparePathFilter (ch.cyberduck.core.synchronization.DefaultComparePathFilter)1 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)1 OverwriteFilter (ch.cyberduck.core.transfer.download.OverwriteFilter)1 DownloadSymlinkResolver (ch.cyberduck.core.transfer.symlink.DownloadSymlinkResolver)1 UploadSymlinkResolver (ch.cyberduck.core.transfer.symlink.UploadSymlinkResolver)1 Test (org.junit.Test)1