I need to be able to build all directories up to and including the directory specified by my File object. For example, suppose I have something like this:
File file = new File( "/var/a/b/c/d/" );
But only /var/
exists. I need a method that builds up to d
, and I was wondering if there was a method in a java io library somewhere that does this already.
mkdirs()
in java.io.File
does the trick.
File file = new File("/var/a/b/c/d");
file.mkdirs();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With