List of utility methods to do File Base Name Get
String | basename(final String name) basename final int colon = name.indexOf(':'); if (colon != -1) { return name.substring(colon + 1); } else { return name; |
String | baseName(String controllerName) base Name if (controllerName.endsWith(CONTROLLER_SUFFIX)) { return controllerName.substring(0, controllerName.length() - CONTROLLER_SUFFIX.length()); return controllerName; |
String | baseName(String filename) Strip a filename of its last extension (the portion immediately following the last dot character, if any) int i = filename.lastIndexOf('.'); return (i > -1) ? filename.substring(0, i) : filename; |
String | baseName(String filename) base Name return baseName(filename, "."); |
String | basename(String filename) basename String result = filename; int p = result.lastIndexOf('/'); if (p >= 0) { result = result.substring(p + 1); p = result.lastIndexOf('.'); if (p >= 0) { result = result.substring(0, p); ... |
String | baseName(String filename) Returns the basename of a filename. if (filename == null) return ""; String basename = filename; int idx = basename.lastIndexOf('/'); if (idx >= 0) { idx++; if (basename.length() == idx) return ""; ... |
String | baseName(String fn) Given a full or partial path name, locate the "base name" from the name. String separator = System.getProperty("file.separator"); int sepLen = separator.length(); int startPos = fn.length() - sepLen; if (startPos < 0) return ""; int pos; for (pos = startPos; pos >= 0; pos--) { String testChar = fn.substring(pos, pos + sepLen); ... |
String | baseName(String name) Search for both slashes in order to support URLs and files. int index = name.lastIndexOf('\\'); if (index < 0) { index = name.lastIndexOf('/'); if (index >= 0) return name.substring(index + 1); else { int lastColonIndex = name.lastIndexOf(':'); ... |
String | basename(String name, String split) return String basename if (name == null || name.equals("")) { return ""; if (split == null || split.equals("")) { split = "."; int index = name.lastIndexOf(split); if (index >= 0) { ... |
String | basename(String path) Return the filename portion of a path. String filename = path.substring(path.lastIndexOf('/') + 1); if (filename == null || filename.equalsIgnoreCase("")) { filename = ""; return filename; |