Java Directory Create mkdir(File dir)

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

Description

mkdir

License

Open Source License

Declaration

public static synchronized void mkdir(File dir) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    public static synchronized void mkdir(File dir) throws Exception {
        if (dir.isFile()) {
            throw new Exception("Can't create directory, file exists " + dir);
        }/*  w w  w . j av a2  s.co  m*/
        if (!dir.exists() && !dir.mkdirs()) {
            throw new Exception("Failed creating directory " + 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, boolean createDirectoryIfNotExisting)
  9. mkdir(File directory)