@Test public void testParse() { FTPFile parsed; parsed = parser.parseFTPEntry( "-rw-r--r-- FTP User 10439 Apr 20 05:29 ASCheckbox_2_0.zip" ); assertNotNull(parsed); assertEquals("ASCheckbox_2_0.zip", parsed.getName()); assertEquals(FTPFile.FILE_TYPE, parsed.getType()); assertEquals(10439, parsed.getSize()); assertEquals(Calendar.APRIL, parsed.getTimestamp().get(Calendar.MONTH)); assertEquals(20, parsed.getTimestamp().get(Calendar.DAY_OF_MONTH)); assertTrue(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.READ_PERMISSION)); assertTrue(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.WRITE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.USER_ACCESS, FTPFile.EXECUTE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.GROUP_ACCESS, FTPFile.EXECUTE_PERMISSION)); assertFalse(parsed.hasPermission(FTPFile.WORLD_ACCESS, FTPFile.EXECUTE_PERMISSION)); }
@Override public FTPFile parseFTPEntry(String entry) { if(matches(entry)) { String typeStr = group(1); String usr = group(15); String grp = group(16); String filesize = group(17); String datestr = group(18) + " " + group(19); String name = group(20); String endtoken = group(21); return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken); } return null; }
TrellixFTPEntryParser extends CommonUnixFTPEntryParser { @Override public FTPFile parseFTPEntry(String entry) { if(matches(entry)) { String typeStr = group(1); String usr = group(15); String grp = group(16); String filesize = group(17); String datestr = group(18) + " " + group(19); String name = group(20); String endtoken = group(21); return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken); } return null; } }
TrellixFTPEntryParser extends CommonUnixFTPEntryParser { @Override public FTPFile parseFTPEntry(String entry) { if(matches(entry)) { String typeStr = group(1); String usr = group(15); String grp = group(16); String filesize = group(17); String datestr = group(18) + " " + group(19); String name = group(20); String endtoken = group(21); return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken); } return null; } TrellixFTPEntryParser(); }
TrellixFTPEntryParser extends CommonUnixFTPEntryParser { @Override public FTPFile parseFTPEntry(String entry) { if(matches(entry)) { String typeStr = group(1); String usr = group(15); String grp = group(16); String filesize = group(17); String datestr = group(18) + " " + group(19); String name = group(20); String endtoken = group(21); return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken); } return null; } TrellixFTPEntryParser(); @Override FTPFile parseFTPEntry(String entry); }
TrellixFTPEntryParser extends CommonUnixFTPEntryParser { @Override public FTPFile parseFTPEntry(String entry) { if(matches(entry)) { String typeStr = group(1); String usr = group(15); String grp = group(16); String filesize = group(17); String datestr = group(18) + " " + group(19); String name = group(20); String endtoken = group(21); return super.parseFTPEntry(typeStr, usr, grp, filesize, datestr, name, endtoken); } return null; } TrellixFTPEntryParser(); @Override FTPFile parseFTPEntry(String entry);  }