List of utility methods to do Folder Create
String | createPath(String folderName, String fileName) create Path return folderName + System.getProperties().getProperty("file.separator") + fileName; |
void | forceFolderExist(String folder) Create folder if it's not exist File flTemp = new File(folder); if (!flTemp.exists()) { if (!flTemp.mkdirs()) throw new IOException("Could not create folder " + folder); } else if (!flTemp.isDirectory()) throw new IOException("A file with name" + folder + " already exist"); |
void | makeParent(File file) make Parent if (file.getParentFile() != null && !file.getParentFile().exists()) {
file.getParentFile().mkdirs();
|
void | makeParent(String file) make Parent makeParent(new File(file));
|
File | getFolderInTarget(String folderName) get Folder In Target File folder = new File(new File("").getAbsoluteFile(), "target" + File.separator + folderName); if (!folder.exists()) { folder.mkdirs(); return folder; |