List of utility methods to do Directory Create
File | mkdirs(File dir) mkdirs if (!dir.exists()) { dir.mkdirs(); return dir; |
boolean | mkdirs(File dir) Just a simple wrapper around `java.util.File.mkdirs()` that fails when trying to create a folder named "~" String path = dir.getPath().replace('\\', '/'); if (path.equals("~") || path.startsWith("~/") || path.contains("/~/")) { return false; return dir.mkdirs(); |
File | mkdirs(File dir) mkdirs if (dir == null) return null; if (!dir.exists() && !dir.mkdirs()) throw new RuntimeException("ERROR: mkdirs: " + dir); return dir; |
boolean | mkdirs(File directory) Creates a new directory. if (directory.exists()) return false; if (!directory.mkdirs()) throw new IOException("cannot create the directory: " + directory); return true; |
void | mkdirs(File directory) Method description if (!directory.exists() && !directory.mkdirs()) { throw new IllegalStateException("could not create directory ".concat(directory.getPath())); |
boolean | mkdirs(File directory) mkdirs if (directory == null) { return false; if (directory.exists()) { return false; if (directory.mkdir()) { return true; ... |
File | mkdirs(File directory, String string) mkdirs File path = new File(directory, string); mkdirs(path); return path; |
void | mkdirs(File dirs) CreatingUtils all folders at once. if (dirs.exists()) { if (dirs.isDirectory() == false) { throw new IOException("Directory '" + "' is not a directory."); return; if (dirs.mkdirs() == false) { throw new IOException("Unable to create directory '" + dirs + "'."); ... |
boolean | mkdirs(File dumpFile) mkdirs File dir = dumpFile.getParentFile();
return dir.exists() || dir.mkdirs();
|
void | mkdirs(File f) A hopefully more robust to concurrent creation mkdirs method: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4742723 if (f.mkdir() || f.exists()) { return; File canonFile; try { canonFile = f.getCanonicalFile(); } catch (IOException e) { return; ... |