use of ch.cyberduck.core.transfer.symlink.DisabledUploadSymlinkResolver in project cyberduck by iterate-ch.
the class SkipFilterTest method testAccept.
@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, final ListProgressListener listener) {
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)));
}
use of ch.cyberduck.core.transfer.symlink.DisabledUploadSymlinkResolver in project cyberduck by iterate-ch.
the class CompareFilterTest method testAcceptDirectory.
@Test
public void testAcceptDirectory() throws Exception {
final Host host = new Host(new TestProtocol());
final CompareFilter filter = new CompareFilter(new DisabledUploadSymlinkResolver(), new NullSession(host), new UploadFilterOptions(host), new DisabledProgressListener(), new DefaultComparePathFilter(new NullSession(host), null) {
@Override
public Comparison compare(final Path file, final Local local, final ProgressListener listener) {
return Comparison.equal;
}
});
assertTrue(filter.accept(new Path("/n", EnumSet.of(Path.Type.directory)), new NullLocal("/n") {
@Override
public boolean exists() {
return true;
}
}, new TransferStatus().exists(true)));
}
use of ch.cyberduck.core.transfer.symlink.DisabledUploadSymlinkResolver in project cyberduck by iterate-ch.
the class OverwriteFilterTest method testAcceptRemoteExists.
@Test
public void testAcceptRemoteExists() throws Exception {
final OverwriteFilter f = new OverwriteFilter(new DisabledUploadSymlinkResolver(), new NullSession(new Host(new TestProtocol())));
assertTrue(f.accept(new Path("a", EnumSet.of(Path.Type.directory)) {
}, new NullLocal("t") {
@Override
public boolean exists() {
return true;
}
}, new TransferStatus()));
assertTrue(f.accept(new Path("a", EnumSet.of(Path.Type.directory)) {
}, new NullLocal("t") {
@Override
public boolean exists() {
return true;
}
}, new TransferStatus()));
}
use of ch.cyberduck.core.transfer.symlink.DisabledUploadSymlinkResolver in project cyberduck by iterate-ch.
the class OverwriteFilterTest method testSize.
@Test
public void testSize() throws Exception {
final OverwriteFilter f = new OverwriteFilter(new DisabledUploadSymlinkResolver(), new NullSession(new Host(new TestProtocol())));
assertEquals(1L, f.prepare(new Path("/t", EnumSet.of(Path.Type.file)) {
}, new NullLocal("/t") {
@Override
public LocalAttributes attributes() {
return new LocalAttributes("/t") {
@Override
public long getSize() {
return 1L;
}
};
}
@Override
public boolean isFile() {
return true;
}
}, new TransferStatus(), new DisabledProgressListener()).getLength(), 0L);
}
use of ch.cyberduck.core.transfer.symlink.DisabledUploadSymlinkResolver in project cyberduck by iterate-ch.
the class OverwriteFilterTest method testOverrideDirectoryWithFile.
@Test(expected = AccessDeniedException.class)
public void testOverrideDirectoryWithFile() throws Exception {
final AbstractUploadFilter f = new OverwriteFilter(new DisabledUploadSymlinkResolver(), new NullSession(new Host(new TestProtocol()))).withFinder(new Find() {
@Override
public boolean find(final Path file, final ListProgressListener listener) {
if (file.getType().contains(Path.Type.file)) {
return false;
}
return true;
}
});
f.prepare(new Path("a", EnumSet.of(Path.Type.file)), new NullLocal(System.getProperty("java.io.tmpdir"), "f"), new TransferStatus().exists(true), new DisabledProgressListener());
}
Aggregations