Java Create Directory mkdir(String path)

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

Description

make a new directory

License

Apache License

Parameter

Parameter Description
path a parameter

Declaration

public static void mkdir(String path) 

Method Source Code


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

import java.io.File;

public class Main {
    /**/*from   ww  w .j  av a 2 s.c  o  m*/
     * make a new directory
     * @param path
     */
    public static void mkdir(String path) {
        File file = new File(path);
        if (!file.exists()) {
            file.mkdirs();
        } else {
            System.err.println("File " + path + " exists already!");
        }
    }
}

Related

  1. mkDir(String fullPath, String directoryPath)
  2. mkdir(String mkdirName)
  3. mkdir(String name)
  4. mkdir(String name)
  5. mkdir(String name, File dir)
  6. mkdir(String path)
  7. mkDir(String path)
  8. mkdir(String s)
  9. mkdir(String save)