Java Create Directory mkDir(String path)

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

Description

mk Dir

License

GNU General Public License

Declaration

public static boolean mkDir(String path) 

Method Source Code

//package com.java2s;
// This file is part of MarMoT, which is licensed under GPLv3.

import java.io.File;

public class Main {
    public static boolean mkDir(String path) {
        File file = new File(path);

        if (file.exists()) {
            if (!file.isDirectory()) {
                throw new RuntimeException("File exists and is not a directory: " + path);
            }/*w w  w. java2 s  . c  om*/
            return true;
        }

        return file.mkdirs();
    }
}

Related

  1. mkdir(String name)
  2. mkdir(String name)
  3. mkdir(String name, File dir)
  4. mkdir(String path)
  5. mkdir(String path)
  6. mkdir(String s)
  7. mkdir(String save)
  8. mkdir(String sFullDirName)
  9. mkDirAndFile(File file)