Java Directory Create mkdir(File dir)

Here you can find the source of mkdir(File dir)

Description

mkdir

License

Apache License

Declaration

public static void mkdir(File dir) 

Method Source Code


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

import java.io.File;

public class Main {

    public static void mkdir(File dir) {
        if (dir.exists()) {
            if (!dir.isDirectory()) {
                throw new IllegalArgumentException("specified path is already exists,"
                        + " and not a directory. path=[" + dir.getAbsolutePath() + "]");
            }//from  w  ww  .  j  a v  a 2  s  .  com
        } else if (!dir.mkdirs()) {
            throw new RuntimeException("failed to create directory. path=[" + dir + "]");
        }
    }
}

Related

  1. mkdir(File dir)
  2. mkdir(File dir)
  3. mkdir(File dir)
  4. mkdir(File dir)
  5. mkdir(File dir)
  6. mkdir(File dir)
  7. mkDir(File dir)
  8. mkDir(File dir)
  9. mkdir(File dir, boolean createDirectoryIfNotExisting)