List of utility methods to do File Name Get
String | getFileName(Class cls, String ext) get File Name return new File(CODEGENDIR, cls.getSimpleName() + ext).getAbsolutePath(); |
String | getFileName(File element) get File Name String name = element.getName();
return name.length() == 0 ? element.getPath() : name;
|
String | getFileName(File f) get File Name String ext = null; String s = f.getName(); int i = s.lastIndexOf(File.pathSeparatorChar); if (i > 0 && i < s.length() - 1) { ext = s.substring(i + 1).toLowerCase(); return ext; |
String | getFileName(File f) Return the file name without path or extension. if (f == null) return null; String fn = f.getName(); if (fn.length() <= 0 || fn.equals(".") || fn.equals("..")) return fn; int p = fn.lastIndexOf('.'); if (p < 0) return fn; ... |
String | getFileName(File f) get File Name int pos = f.getName().lastIndexOf("."); String fileName = f.getName().substring(0, pos); return fileName; |
String | getFileName(File file) get File Name String[] nameArr = file.getName().split("\\."); StringBuilder name = new StringBuilder(); for (int i = 0; i < nameArr.length - 1; i++) { name.append(nameArr[i]); if (i != nameArr.length - 2) { name.append("."); return name.toString(); |
String | getFileName(File file) Returns file name. return (file != null) ? file.getName() : ""; |
String | getFileName(File file) Returns the name of the given file. if (file == null) { return null; String name = file.getName(); int lastIndexOfDot = name.lastIndexOf('.'); if (lastIndexOfDot != -1) { return name.substring(0, lastIndexOfDot); return name; |
String | getFileName(File file) get File Name return file.getName();
|
String | getFilename(File file) Get file name from the specified File object. if (file != null) { String path = file.getPath(); int len = path.length(); int num2 = len; while (--num2 >= 0) { char ch1 = path.charAt(num2); if (ch1 == File.separatorChar) return path.substring(num2 + 1, len); ... |