List of utility methods to do mkdir
String | makeDirectories(String path) make Directories try { File file = new File(path); file.mkdirs(); return file.getCanonicalPath(); } catch (IOException e) { return null; |
void | makeDirectories(String path) Create a directory structure File target = new File(path); if (target.exists()) { if (!target.isDirectory()) { throw new IOException("Target directory for generating CreativeWorks files is actually a file"); } else { target.mkdirs(); |
void | makeDirectory(File dir) make Directory if (dir.exists()) { if (!dir.isDirectory()) { throw new IOException("File '" + dir + "' is already exist"); } else { if (!dir.mkdirs()) { throw new IOException("Cannot create directory '" + dir + "'"); |
void | makeDirectory(File directory) make Directory if (!directory.exists() && !directory.mkdirs()) { throw new RuntimeException(String.format("Directory %s can not be created", directory)); |
void | makeDirectory(File file) Creates directories if not exists. if (!file.isDirectory()) { if (!file.mkdirs() || !file.isDirectory()) { throw new IOException("can't make directory: " + file); |
boolean | makeDirectory(File file) make Directory File parent = file.getParentFile();
return parent != null && parent.mkdirs();
|
boolean | makeDirectory(File file) make Directory return file.mkdirs();
|
void | makedirectory(File outputDirectory, String directoryName) Create a directory File directory = new File(outputDirectory, directoryName); if (!directory.exists()) { directory.mkdirs(); |
boolean | makeDirectory(File testDir ) Utility for making dirs if (testDir == null) { return false; if (testDir.isDirectory()) { return true; return testDir.mkdirs(); |
File | makeDirectory(final CharSequence aPath) Returns a valid directory from the given path (it may return the parent directory). final File directory = new File(aPath.toString()); if (!directory.exists()) { if (!directory.mkdirs()) { throw new IOException("Directory not created. Already existing ?"); } else if (!directory.isDirectory()) { throw new IOException("'" + aPath + "' is not a valid directory."); return directory; |