List of utility methods to do File Name Get
String | getFileNameWithoutExtension(String fullFilename) Returns file name without extension. final String fileName = new File(fullFilename).getName(); final int dotIndex = fileName.lastIndexOf('.'); final String fileNameWithoutExtension; if (dotIndex == -1) { fileNameWithoutExtension = fileName; } else { fileNameWithoutExtension = fileName.substring(0, dotIndex); return fileNameWithoutExtension; |
String | getFileNameWithoutExtensionFromPath(String s) get File Name Without Extension From Path s = s.replace(File.separatorChar, '/'); s = getLastPortion(s, '/'); int k = s.lastIndexOf('.'); if (k != -1) { return s.substring(0, k); } else return s; |
String | getFilenameWithoutExtention(File file) get Filename Without Extention return stripExtension(file.getName());
|
String | getFileNameWithoutFilePath(File f) Returns the file name of a file, without the path. return f.getName();
|
String | getFilenameWithoutPath(String path) Takes a filename with path and returns just the filename. File f = new File(path); return f.getName(); |
String | getFileNameWithPath(String path, String fileNameWithoutFullPath) get File Name With Path return path + File.separator + fileNameWithoutFullPath;
|