List of utility methods to do File Name Get
String | getFileName() get File Name SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd_HH-mm-ss_SS"); String fileName = format.format(new Timestamp(System .currentTimeMillis())); return fileName; |
String | getFileName(String path) get File Name return path.substring(path.lastIndexOf("/") + 1); |
String | getFileNameFromURL(String url) Dado o url de um ficheiro deviolve o seu nome. if (url == null) { return null; } else if (url.equals("")) { return url; } else { return (url.substring(url.lastIndexOf("/") + 1)); |
String | getFileNameFromURL(URL url) get File Name From URL String fileName = url.getFile(); return fileName.substring(fileName.lastIndexOf('/') + 1); |
String | getFileNameOnly(String filename) get File Name Only String extension = filename.substring(0, filename.lastIndexOf(".")); return extension; |
String | getFilenameFromPath(String path) get Filename From Path return new File(path).getName(); |