List of utility methods to do Directory Exist Check
void | checkDir(String dir, boolean mustExist) check Dir File file = new File(dir); if ((mustExist && !file.exists()) || file.isFile()) { throw new IllegalStateException("must be dir"); |
void | checkDirectory(String name, boolean createIfNonExistent) Checks if a directory exists. File f = new File(name); if ((f.exists()) && (!f.isDirectory())) { throw new IOException("Directory " + name + "already exists but is not a directory"); if ((!f.exists() && (!createIfNonExistent))) { throw new IOException("Directory " + name + " does not exist"); if (!f.exists() && (createIfNonExistent)) { ... |
boolean | checkDirectoryExists(String path) check Directory Exists boolean exists; File directory = new File(path); exists = directory.exists() || directory.mkdirs(); return exists; |
Boolean | checkDirExist(String path) check Dir Exist File file = new File(path); if (!file.exists()) { file.mkdirs(); System.out.println("Launcher.checkDirExist()#File doesn't exist, create new: " + path); return false; return true; |
void | checkDirExistence(String dir) check Dir Existence File f = new File(dir); if (!f.isDirectory()) { throw new RuntimeException("File: " + f + " is not a dir"); if (!f.exists()) { throw new RuntimeException("Dir: " + f + " does not exist"); |
void | checkDirExistenceOrCreateMissingParts(final String dirPath) check Dir Existence Or Create Missing Parts final File dirFile = new File(dirPath); if (!dirFile.exists()) { dirFile.mkdirs(); |
boolean | checkDirExists(File dir) check Dir Exists if (dir.isDirectory()) { return true; } else { return dir.mkdirs(); |
boolean | checkDirExists(String dir) check Dir Exists File file = new File(dir); return file.isDirectory(); |
void | CheckDirExists(String dir, String name) Check Dir Exists File dirFile = new File(dir); if (!dirFile.exists()) { throw new IllegalArgumentException( "GDAJythonInterpreter.CheckDirExists: " + name + " - " + dir + " does not exist"); |