use of ch.cyberduck.core.ftp.FTPWorkdirService in project cyberduck by iterate-ch.
the class FTPListServiceTest method testListEmptyDirectoryList.
@Test
public void testListEmptyDirectoryList() throws Exception {
final FTPListService list = new FTPListService(session, null, TimeZone.getDefault());
list.remove(FTPListService.Command.stat);
list.remove(FTPListService.Command.lista);
list.remove(FTPListService.Command.mlsd);
final Path home = new FTPWorkdirService(session).find();
final Path directory = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
new FTPDirectoryFeature(session).mkdir(directory, new TransferStatus());
assertTrue(list.list(directory, new DisabledListProgressListener()).isEmpty());
new FTPDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
use of ch.cyberduck.core.ftp.FTPWorkdirService in project cyberduck by iterate-ch.
the class FTPListServiceTest method testList.
@Test
public void testList() throws Exception {
final ListService service = new FTPListService(session, null, TimeZone.getDefault());
final Path directory = new FTPWorkdirService(session).find();
final Path file = new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new FTPTouchFeature(session).touch(file, new TransferStatus());
final Permission permission = new Permission(Permission.Action.read_write, Permission.Action.read_write, Permission.Action.read_write);
final AttributedList<Path> list = service.list(directory, new DisabledListProgressListener() {
@Override
public void chunk(final Path parent, AttributedList<Path> list) {
assertFalse(list.isEmpty());
}
});
assertTrue(list.contains(file));
new FTPDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
use of ch.cyberduck.core.ftp.FTPWorkdirService in project cyberduck by iterate-ch.
the class FTPStatListServiceTest method testList.
@Test
public void testList() throws Exception {
final ListService service = new FTPStatListService(session, new CompositeFileEntryParser(Collections.singletonList(new UnixFTPEntryParser())));
final Path directory = new FTPWorkdirService(session).find();
final Path file = new Path(directory, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
new FTPTouchFeature(session).touch(file, new TransferStatus());
final AttributedList<Path> list = service.list(directory, new DisabledListProgressListener());
assertTrue(list.contains(file));
}
Aggregations