Check out example codes for "java create directory if not exists". It will help you in understanding the concepts better.

Code Example 1

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

if (!Files.exists(Paths.get(path))) {
	pathAsFile.mkdir();
}

Learn ReactJs, React Native from akashmittal.com