@Test public void testIsDir() { assertTrue(SimpleGarbageCollector.isDir("tid1/dir1")); assertTrue(SimpleGarbageCollector.isDir("/dir1")); assertFalse(SimpleGarbageCollector.isDir("file1")); assertFalse(SimpleGarbageCollector.isDir("/dir1/file1")); assertFalse(SimpleGarbageCollector.isDir("")); assertFalse(SimpleGarbageCollector.isDir(null)); }
static boolean isDir(String delete) { if (delete == null) { return false; } int slashCount = 0; for (int i = 0; i < delete.length(); i++) { if (delete.charAt(i) == '/') { slashCount++; } } return slashCount == 1; }
SimpleGarbageCollector extends AbstractServer implements Iface { static boolean isDir(String delete) { if (delete == null) { return false; } int slashCount = 0; for (int i = 0; i < delete.length(); i++) { if (delete.charAt(i) == '/') { slashCount++; } } return slashCount == 1; } }
SimpleGarbageCollector extends AbstractServer implements Iface { static boolean isDir(String delete) { if (delete == null) { return false; } int slashCount = 0; for (int i = 0; i < delete.length(); i++) { if (delete.charAt(i) == '/') { slashCount++; } } return slashCount == 1; } SimpleGarbageCollector(ServerOpts opts, String[] args); }
SimpleGarbageCollector extends AbstractServer implements Iface { static boolean isDir(String delete) { if (delete == null) { return false; } int slashCount = 0; for (int i = 0; i < delete.length(); i++) { if (delete.charAt(i) == '/') { slashCount++; } } return slashCount == 1; } SimpleGarbageCollector(ServerOpts opts, String[] args); static void main(String[] args); @Override @SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit") void run(); @Override GCStatus getStatus(TInfo info, TCredentials credentials); GcCycleMetrics getGcCycleMetrics(); }
SimpleGarbageCollector extends AbstractServer implements Iface { static boolean isDir(String delete) { if (delete == null) { return false; } int slashCount = 0; for (int i = 0; i < delete.length(); i++) { if (delete.charAt(i) == '/') { slashCount++; } } return slashCount == 1; } SimpleGarbageCollector(ServerOpts opts, String[] args); static void main(String[] args); @Override @SuppressFBWarnings(value = "DM_EXIT", justification = "main class can call System.exit") void run(); @Override GCStatus getStatus(TInfo info, TCredentials credentials); GcCycleMetrics getGcCycleMetrics();  }