Here you can find the source of mkdir(File dir)
public static synchronized void mkdir(File dir) throws Exception
//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); } } }