List of utility methods to do Directory Create
void | mkdir(File file) mkdir if (file.exists()) { return; File pFile = file.getParentFile(); if (pFile != null) { mkdir(pFile); file.mkdir(); ... |
File | mkdir(File parent, String... segments) mkdir File dir = parent; for (String segment : segments) { dir = new File(dir, segment); dir.mkdirs(); return dir; |
File | mkdir(File parentDir, String name) mkdir final File directory = new File(parentDir, name); if (!directory.mkdir()) { throw new IOException(); return directory; |
boolean | mkdirs(File dir) Creates a directory if the directory doesn't exists. return dir.isDirectory() || dir.mkdirs() || dir.isDirectory();
|
void | mkdirs(File dir) mkdirs if (dir.exists()) { if (!dir.isDirectory()) { throw new IOException( "Failed to create directory '" + dir + "', regular file already existed with that name"); } else { if (!dir.mkdirs()) { throw new IOException("Failed to create directory '" + dir + "'"); ... |
File | mkdirs(File dir) Ensures that the given directory exists (if not, it's created, including all the parent directories.) if (dir.mkdirs() || dir.exists()) return dir; try { Thread.sleep(10); } catch (InterruptedException e) { if (dir.mkdirs() || dir.exists()) return dir; ... |
boolean | mkdirs(File dir) mkdirs assert dir != null; return dir.mkdirs() || dir.exists(); |
void | mkdirs(File dir) create specified directory if doesn't exist. if (!dir.exists() && !dir.mkdirs()) throw new IOException("couldn't create directory: " + dir); |
boolean | mkdirs(File dir) Mkdirs. synchronized (mkdirsMutex) { try { mkdirsThread = Thread.currentThread(); mkdirsStartTime = System.currentTimeMillis(); return dir.mkdirs(); } finally { mkdirsThread = null; |
void | mkdirs(File dir) Create directories, throw exception if not possible. if (!dir.exists()) { if (!dir.mkdirs()) { throw new RuntimeException("Could not create directory : " + dir.getParentFile()); return; if (!dir.isDirectory()) { throw new RuntimeException("Should be a directory but is not: " + dir); ... |