Java mkdir makeDirectories(final String location)

Here you can find the source of makeDirectories(final String location)

Description

Makes the directory for the given location if it doesn't exist.

License

BSD License

Parameter

Parameter Description
location the location to make the directory.

Declaration

public static void makeDirectories(final String location) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.io.File;

public class Main {
    /**//from   w  w  w .  ja  va2 s .c  o m
     * Makes the directory for the given location if it doesn't exist.
     *
     * @param location the location to make the directory.
     */
    public static void makeDirectories(final String location) {
        final File file = new File(location);
        makeDirectories(file);
    }

    /**
     * Makes the directory for the given location if it doesn't exist.
     *
     * @param location the location to make the directory.
     */
    public static void makeDirectories(final File location) {
        final File parent = location.getParentFile();
        if (parent != null) {
            parent.mkdirs();
        }
    }
}

Related

  1. makeDir(String path)
  2. makeDir(String path)
  3. makeDirByChild(File file)
  4. makeDirDirs(String dir)
  5. makeDirectories(final File file)
  6. makeDirectories(JarFile jar, String eviwareDir)
  7. makeDirectories(String path)
  8. makeDirectories(String path)
  9. makeDirectory(File dir)