create directory if not exists java code example
Example 1: java create directory if not exists
String path = ...
File pathAsFile = new File(path);
if (!Files.exists(Paths.get(path))) {
pathAsFile.mkdir();
}
Example 2: java files createdirectories if they don't exist
//Doesnt throw errors if a directorie already exists
Files.createDirectories(Paths.get("/Your/Path/Here"));