Java Directory Create mkdir(File dir)

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

Description

CreatingUtils single folders.

License

Open Source License

Declaration

public static void mkdir(File dir) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.IOException;

public class Main {
    /**/*from  ww  w  .  jav  a  2 s . c om*/
     * CreatingUtils single folder.
     */
    public static void mkdir(String dir) throws IOException {
        mkdir(new File(dir));
    }

    /**
     * CreatingUtils single folders.
     */
    public static void mkdir(File dir) throws IOException {
        if (dir.exists()) {
            if (dir.isDirectory() == false) {
                throw new IOException("Destination '" + "' is not a directory.");
            }
            return;
        }
        if (dir.mkdir() == false) {
            throw new IOException("Unable to create directory '" + dir + "'.");
        }
    }
}

Related

  1. mkdir(File d)
  2. mkdir(File dir)
  3. mkdir(File dir)
  4. mkdir(File dir)
  5. mkdir(File dir)
  6. mkdir(File dir)
  7. mkdir(File dir)