1. Introduction
The mkdirs() method that creates a directory with all given parent directories.
2. Method signature
Parameters:
- method does not take any parameter
Returns
- true - the directory was created, along with all necessary parent directories; false otherwise
Throws
- SecurityException - when we do not have access to the file or directory
3. Examples
3.1. Creating directory aaa
in parent directory zzz
in parent directory ttt
in existing directory \tmp
The output:
4. Conclusion
In this article, we presented mkdirs()
method that creates a directory in Java with all parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories.
{{ 'Comments (%count%)' | trans {count:count} }}
{{ 'Comments are closed.' | trans }}