List of utility methods to do File Name Extract
String | extractFilenameFromURL(String url) extract Filename From URL if (url.contains("/")) { return url.substring(url.lastIndexOf('/') + 1, url.length()); return url; |
String | extractFileNameFromUrl(String url) extract File Name From Url String newFileName = ""; String tempStr = ""; int counter = url.length() - 1; char ch = url.charAt(counter); while (ch != '/') { tempStr += ch; ch = url.charAt(counter); counter--; ... |
String | extractFilenameFromUrlPath(String urlPath) Extract the URL filename from the given request URL path. String filename = extractFullFilenameFromUrlPath(urlPath); int dotIndex = filename.lastIndexOf('.'); if (dotIndex != -1) { filename = filename.substring(0, dotIndex); return filename; |
String[] | extractFileNames(String[] fileNames) extract File Names String[] newFileNames = new String[fileNames.length]; for (int i = 0; i < fileNames.length; i++) { newFileNames[i] = extractFileName(fileNames[i]); return newFileNames; |