Answers for "java check if directory exists and create"

3

java create directory if not exists

String path = ...
File pathAsFile = new File(path);

if (!Files.exists(Paths.get(path))) {
	pathAsFile.mkdir();
}
Posted by: Guest on April-27-2020
3

java check if directory exists

Path path = ...;

if (Files.exists(path)) {
    // ...
}
Posted by: Guest on April-27-2020

Code answers related to "java check if directory exists and create"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language