@Test public void testGetFilename() throws Exception { String filename = "/foo/bar/jar.txt"; assertEquals("jar.txt", FileTools.getFilename(filename)); }
public static String getFilename(String filePath) { if (filePath == null || "".equals(filePath)) { return null; } String[] tokens = filePath.split("/"); return (tokens[tokens.length - 1]); }
FileTools { public static String getFilename(String filePath) { if (filePath == null || "".equals(filePath)) { return null; } String[] tokens = filePath.split("/"); return (tokens[tokens.length - 1]); } }
FileTools { public static String getFilename(String filePath) { if (filePath == null || "".equals(filePath)) { return null; } String[] tokens = filePath.split("/"); return (tokens[tokens.length - 1]); }  }
FileTools { public static String getFilename(String filePath) { if (filePath == null || "".equals(filePath)) { return null; } String[] tokens = filePath.split("/"); return (tokens[tokens.length - 1]); }  static String byte2HexString(byte[] b); static ReturnValue verifyFile(File file); static ReturnValue dirPathExistsAndWritable(File file); static ReturnValue dirPathExistsAndReadable(File file); static ReturnValue fileExistsAndReadable(File file); static ReturnValue fileExistsAndNotEmpty(File file); static File createTempDirectory(File parentDir); static File createDirectoryWithUniqueName(File parentDir, String prefix); static File createFileWithUniqueName(File parentDir, String prefix); static boolean deleteDirectoryRecursive(File path); static boolean zipDirectoryRecursive(File path, File zipFileName, boolean compress); static boolean unzipFile(File path, File outputDir); static void listFilesRecursive(File path, List<File> filesArray); static Map<String, String> getKeyValueFromFile(String path); static boolean isFileOwner(String path); static String whoAmI(); static String getFilename(String filePath); static String getFilePath(String filePath); static LocalhostPair getLocalhost(OptionSet options); }
FileTools { public static String getFilename(String filePath) { if (filePath == null || "".equals(filePath)) { return null; } String[] tokens = filePath.split("/"); return (tokens[tokens.length - 1]); }  static String byte2HexString(byte[] b); static ReturnValue verifyFile(File file); static ReturnValue dirPathExistsAndWritable(File file); static ReturnValue dirPathExistsAndReadable(File file); static ReturnValue fileExistsAndReadable(File file); static ReturnValue fileExistsAndNotEmpty(File file); static File createTempDirectory(File parentDir); static File createDirectoryWithUniqueName(File parentDir, String prefix); static File createFileWithUniqueName(File parentDir, String prefix); static boolean deleteDirectoryRecursive(File path); static boolean zipDirectoryRecursive(File path, File zipFileName, boolean compress); static boolean unzipFile(File path, File outputDir); static void listFilesRecursive(File path, List<File> filesArray); static Map<String, String> getKeyValueFromFile(String path); static boolean isFileOwner(String path); static String whoAmI(); static String getFilename(String filePath); static String getFilePath(String filePath); static LocalhostPair getLocalhost(OptionSet options); static final String FORCE_HOST; }