List of utility methods to do Create Directory
boolean | mkdir(String name) Create the specified directory, including any intermediate directories that do not exist. File dir = new File(name); return dir.mkdirs(); |
void | mkdir(String name) mkdir String dir_name = ""; if (name.endsWith(File.separator)) { dir_name = name; } else { String s = File.separator; if (s.equals("\\")) { s = "\\\\"; name = name.replace("/", "\\"); ... |
void | mkdir(String name, File dir) mkdir if (!dir.exists()) { if (!dir.mkdir()) { throw new IOException(name + " create fail!"); |
void | mkdir(String path) make a new directory File file = new File(path); if (!file.exists()) { file.mkdirs(); } else { System.err.println("File " + path + " exists already!"); |
void | mkdir(String path) mkdir File f = new File(path); if (!f.exists()) f.mkdir(); |
boolean | mkDir(String path) mk Dir File file = new File(path); if (file.exists()) { if (!file.isDirectory()) { throw new RuntimeException("File exists and is not a directory: " + path); return true; return file.mkdirs(); ... |
String | mkdir(String s) Creates the directory s (and any parent directories needed). try { if ((new File(s)).mkdirs()) return "Created dir: " + s; else return "Failed to create dir or dir already exists: " + s; } catch (Exception e) { return e.toString(); |
void | mkdir(String save) mkdir if (!new File(save).exists()) { if (!new File(save).mkdirs()) { throw new RuntimeException("Cannot create directory: " + save); |
boolean | mkdir(String sFullDirName) Creates the specified directory and if necessary any parent directories. return md(sFullDirName);
|
void | mkDirAndFile(File file) mk Dir And File if (file.exists()) { return; if (!file.getParentFile().exists()) { mkDir(file.getParentFile()); file.createNewFile(); |