Java mkdir makeDirectories(String path)

Here you can find the source of makeDirectories(String path)

Description

Create a directory structure

License

Apache License

Parameter

Parameter Description
path The path to create

Exception

Parameter Description
IOException If the path could not be created or the path is a file

Declaration

public static void makeDirectories(String path) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {
    /**/*from   w w  w. j  a  va  2s  . com*/
     * Create a directory structure
     * @param path The path to create
     * @throws IOException If the path could not be created or the path is a file
     */
    public static void makeDirectories(String path) throws IOException {
        // 
        File target = new File(path);
        if (target.exists()) {
            if (!target.isDirectory()) {
                throw new IOException(
                        "Target directory for generating CreativeWorks files is actually a file");
            }
        } else {
            target.mkdirs();
        }
    }
}

Related

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