List of utility methods to do mkdir
boolean | makeDirs(final File file) make Dirs if (notExists(file)) { return file.mkdirs(); return false; |
void | makeDirs(String dir) make Dirs File file = new File(dir);
makeDirs(file);
|
boolean | makeDirs(String fileName) make Dirs if (fileName == null || fileName.isEmpty()) { return false; String filePath = fileName.substring(0, fileName.lastIndexOf("/")); File folder = new File(filePath); return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs(); |
void | makedirs(String fileName) makedirs makedirs(new File(fileName));
|
boolean | makeDirs(String fileName, boolean hasFile) make Dirs boolean result = false; if (hasFile) { int lastIndex = fileName.lastIndexOf('/'); if (lastIndex > -1) { String filePath = fileName.substring(0, lastIndex); if (filePath != null && !filePath.equals("")) { result = new File(filePath).mkdirs(); } else { result = new File(fileName).mkdirs(); return result; |
boolean | makeDirs(String filePath) make Dirs String folderName = getFolderName(filePath); if (folderName == null || folderName.trim().length() == 0) { return false; File folder = new File(folderName); return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs(); |
boolean | makeDirs(String strBottomFoldName, String strFoldName) make Dirs boolean blnResult = true; File newFold = new File(strBottomFoldName, strFoldName); if (!newFold.exists() && !newFold.mkdirs()) { blnResult = false; return blnResult; |
void | makeDIRS(String[] dirs, File path) make DIRS File t = null; for (String s : dirs) { s = path.getAbsolutePath() + File.separator + s; new File(s).mkdirs(); |
void | makeDirsFor(File file) Make the directories for the given file to exist in, if they don't already exist. if (file == null) { throw new NullPointerException("file == null"); File parent = file.getParentFile(); if (!parent.exists()) { if (!parent.mkdirs()) { throw new RuntimeException("Unable to make directory: " + parent); if (!parent.isDirectory()) { throw new RuntimeException("Not a directory: " + parent); if (!parent.canWrite()) { throw new RuntimeException("Unable to write to directory: " + parent); |
boolean | makeDirsWhenNotExist(String filePath) make Dirs When Not Exist String separator = null; if (filePath.indexOf("/") > -1) { separator = "/"; } else if (filePath.indexOf("\\") > -1) { separator = "\\"; int index = filePath.lastIndexOf(separator); String cataloguePath = filePath.substring(0, index); ... |