Java Utililty Methods Create Directory

List of utility methods to do Create Directory

Description

The list of methods to do Create Directory are organized into topic(s).

Method

voidmkdirs(final File aDirectory)
mkdirs
boolean success;
if (aDirectory.exists()) {
    success = aDirectory.isDirectory();
} else {
    success = aDirectory.mkdirs();
if (!success) {
    throw new IllegalArgumentException(
...
voidmkdirs(final File dirs)
Creates all folders at once.
if (dirs.exists()) {
    if (!dirs.isDirectory()) {
        throw new IOException(MSG_NOT_A_DIRECTORY + dirs);
    return;
if (!dirs.mkdirs()) {
    throw new IOException(MSG_CANT_CREATE + dirs);
...
voidmkdirs(final File f)
mkdirs
if (f.exists() && !f.isDirectory())
    throw new IOException(String.format("'%s' does already exist but is not a directory.", f));
if (!f.exists() && !f.mkdirs())
    throw new IOException("Could not create folder '" + f + "'.");
booleanmkdirs(final File file)
Creates the directory in privileged mode.
return file.mkdirs();
voidmkdirs(final File outdir, final String path)
Creates directories from an existing file to an additional path.
File d = new File(outdir, path);
if (!d.exists()) {
    d.mkdirs();
booleanmkdirs(final String path)
Creates a directory and parent directories if needed.
return new File(path).mkdirs();
Filemkdirs(final String path)
mkdirs
final File file = new File(path);
if (!file.exists()) {
    final File dir = new File(file.getParent());
    if (!dir.exists()) {
        dir.mkdirs();
return file;
...
voidmkdirs(String destDir)
mkdirs
File dir = new File(destDir);
if (!dir.exists()) {
    dir.mkdirs();
voidmkdirs(String destination)
Creates directory specified by destination, and all its parents if they don't exist.
mkdirs(new File(destination));
booleanmkdirs(String dirName)
mkdirs
File dirPath = new File(dirName);
return dirPath.exists() || dirPath.mkdirs();