use of ch.cyberduck.core.ftp.parser.CompositeFileEntryParser in project cyberduck by iterate-ch.
the class FTPDefaultListServiceTest method testListDefaultFlag.
@Test
public void testListDefaultFlag() throws Exception {
final ListService list = new FTPDefaultListService(session, new CompositeFileEntryParser(Collections.singletonList(new UnixFTPEntryParser())), FTPListService.Command.lista);
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());
assertTrue(list.list(directory, new DisabledListProgressListener()).contains(file));
new FTPDeleteFeature(session).delete(Collections.singletonList(file), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
use of ch.cyberduck.core.ftp.parser.CompositeFileEntryParser in project cyberduck by iterate-ch.
the class FTPListResponseReaderTest method testLimit.
@Test(expected = ListCanceledException.class)
@Ignore
public void testLimit() throws Exception {
final CompositeFileEntryParser parser = new FTPParserSelector().getParser("NETWARE Type : L8");
final AttributedList<Path> list = new FTPListResponseReader(parser).read(new Path("/", EnumSet.of(Path.Type.directory)), Collections.singletonList("lrwxrwxrwx 1 ftp ftp 23 Feb 05 06:51 debian -> ../pool/4/mirror/debian"), new DisabledListProgressListener() {
@Override
public void chunk(final Path parent, AttributedList<Path> list) throws ListCanceledException {
throw new ListCanceledException(AttributedList.<Path>emptyList());
}
});
}
use of ch.cyberduck.core.ftp.parser.CompositeFileEntryParser in project cyberduck by iterate-ch.
the class FTPListResponseReaderTest method testParseAbsolutePaths.
@Test
public void testParseAbsolutePaths() throws Exception {
Path path = new Path("/data/FTP_pub", EnumSet.of(Path.Type.directory));
String[] replies = new String[] { "- [RWCEAFMS] Petersm 0 May 05 2004 /data/FTP_pub/WelcomeTo_PeakFTP" };
final CompositeFileEntryParser parser = new FTPParserSelector().getParser("NETWARE Type : L8");
final AttributedList<Path> list = new FTPListResponseReader(parser).read(path, Arrays.asList(replies), new DisabledListProgressListener());
assertEquals(1, list.size());
final Path parsed = list.get(0);
assertEquals("WelcomeTo_PeakFTP", parsed.getName());
assertEquals("/data/FTP_pub", parsed.getParent().getAbsolute());
assertFalse(parsed.attributes().getPermission().isSticky());
assertFalse(parsed.attributes().getPermission().isSetuid());
assertFalse(parsed.attributes().getPermission().isSetgid());
}
use of ch.cyberduck.core.ftp.parser.CompositeFileEntryParser in project cyberduck by iterate-ch.
the class FTPParserFactory method createMVSEntryParser.
private CompositeFileEntryParser createMVSEntryParser(final TimeZone timezone) {
return new CompositeFileEntryParser(Collections.singletonList(new MVSFTPEntryParser() {
@Override
protected FTPClientConfig getDefaultConfiguration() {
final FTPClientConfig config = super.getDefaultConfiguration();
config.setServerTimeZoneId(timezone.getID());
return config;
}
}));
}
use of ch.cyberduck.core.ftp.parser.CompositeFileEntryParser in project cyberduck by iterate-ch.
the class FTPParserFactory method createOS2FTPEntryParser.
private CompositeFileEntryParser createOS2FTPEntryParser(final TimeZone timezone) {
return new CompositeFileEntryParser(Collections.singletonList(new OS2FTPEntryParser() {
@Override
protected FTPClientConfig getDefaultConfiguration() {
final FTPClientConfig config = super.getDefaultConfiguration();
config.setServerTimeZoneId(timezone.getID());
return config;
}
}));
}
Aggregations