Here you can find the source of mkdir(File dir)
public static void mkdir(File dir) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { /**/*www. jav a 2 s . c o m*/ * 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() && !dir.mkdirs()) { throw new IOException("Unable to create directory '" + dir + "'."); } } /** * CreatingUtils single folder. */ public static void mkdir(String dir) throws IOException { mkdir(new File(dir)); } /** * CreatingUtils all folders at once. */ public static void mkdirs(File dirs) throws IOException { if (dirs.exists()) { if (dirs.isDirectory() == false) { throw new IOException("Directory '" + "' is not a directory."); } return; } if (dirs.mkdirs() == false) { throw new IOException("Unable to create directory '" + dirs + "'."); } } /** * CreatingUtils all folders at once. */ public static void mkdirs(String dirs) throws IOException { mkdirs(new File(dirs)); } }