Wednesday 11 March 2020

Create file parent directories if they are not exist

Below snippet is used to create parent directories of the file, if those are not exist.

String directoryPath = "Enter file absolute path here";
File file = new File(directoryPath);
file.getParentFile().mkdirs();



You may like

No comments:

Post a Comment