List of utility methods to do Path Create
String | getDownloadPath() Gets default directory(path) for downloaded files return System.getProperty("user.home") + "\\Downloads\\"; |
String | getFilePath(String path) get File Path String result = null; if (StringUtil.isNotEmpty(path)) { int num = path.lastIndexOf("/"); int tnum = path.lastIndexOf("\\"); if (tnum > num) num = tnum; if (num > 0) return path.substring(0, num + 1); ... |
String | getPath(String fullFileName) get Path int pos = fullFileName.lastIndexOf("/"); if (pos == -1) { pos = fullFileName.lastIndexOf("\\"); String shortFileName = fullFileName.substring(0, pos); if (StringUtils.isEmpty(shortFileName)) { return "/"; return shortFileName; |
String | getProjectAbsolutePath() get Project Absolute Path return new java.io.File("").getAbsolutePath(); |
String | getUniqueFilePath(String filePath) get the unique file path by add a serial number. int id = 1; File file = new File(filePath); while (file.exists()) { if (file.isDirectory()) { if (id == 1) filePath += "[" + (id++) + "]"; else filePath = filePath.substring(0, ... |
String | getFolderPathNameYearAndMonthSubDirectoryDay() get Folder Path Name Year And Month Sub Directory Day String path = ""; Calendar cal = Calendar.getInstance(); path += String.valueOf(cal.get(Calendar.YEAR)) + "_"; path += String.valueOf(cal.get(Calendar.MONTH) + 1); path += System.getProperties().getProperty("file.separator"); path += String.valueOf(cal.get(Calendar.DATE)); return path; |
String | getNameDelLastPath(String fileName) get Name Del Last Path int point = getPathLastIndex(fileName); if (point == -1) { return fileName; } else { return fileName.substring(0, point); |
String | getPath(String path, String parent) get Path if (path.charAt(0) != separator || (path.length() > 1 && path.charAt(1) == ':' && separator == '\\')) { return parent + separator + path; } else { return path; |
String | getRealPath(String name) Get real path. String senHome = System.getProperty("sen.home"); if (senHome == null) { return name; } else { return senHome + File.separatorChar + name; |
String | getFullPath(String inBaseUrl, String inUrl) get Full Path String path = makeUrl(inBaseUrl, inUrl); if (path == null || path.length() == 0) { return null; if (path.startsWith("/")) { path = F_FILE_SCHEMA + path; return path; ... |