@Test public void testGetFilename() { String filename = getFilename(UNIX_PATH); assertEquals(FILENAME, filename); filename = getFilename(UNIX_PATH, true); assertNotEquals(FILENAME, filename); assertEquals(UNIX_PATH, filename); filename = getFilename(WINDOWS_PATH, true); assertEquals(FILENAME, filename); filename = getFilename(WINDOWS_PATH, false); assertNotEquals(FILENAME, filename); assertEquals(WINDOWS_PATH, filename); }
public static String getFilename(String s, boolean windowsWorkaround) { String result = s; int slashPos = lastSlash(s, windowsWorkaround); if (slashPos >= 0 && s.length() > slashPos) { result = s.substring(slashPos + 1); } return result; }
FtpHelper { public static String getFilename(String s, boolean windowsWorkaround) { String result = s; int slashPos = lastSlash(s, windowsWorkaround); if (slashPos >= 0 && s.length() > slashPos) { result = s.substring(slashPos + 1); } return result; } }
FtpHelper { public static String getFilename(String s, boolean windowsWorkaround) { String result = s; int slashPos = lastSlash(s, windowsWorkaround); if (slashPos >= 0 && s.length() > slashPos) { result = s.substring(slashPos + 1); } return result; }  }
FtpHelper { public static String getFilename(String s, boolean windowsWorkaround) { String result = s; int slashPos = lastSlash(s, windowsWorkaround); if (slashPos >= 0 && s.length() > slashPos) { result = s.substring(slashPos + 1); } return result; }  static String getFilename(String s, boolean windowsWorkaround); static String getDirectory(String s, boolean windows); static String getFilename(String fullPath); static String getDirectory(String fullPath); }
FtpHelper { public static String getFilename(String s, boolean windowsWorkaround) { String result = s; int slashPos = lastSlash(s, windowsWorkaround); if (slashPos >= 0 && s.length() > slashPos) { result = s.substring(slashPos + 1); } return result; }  static String getFilename(String s, boolean windowsWorkaround); static String getDirectory(String s, boolean windows); static String getFilename(String fullPath); static String getDirectory(String fullPath); static final String FORWARD_SLASH; static final String BACK_SLASH; }