Here you can find the source of mkdir(File dir)
public static void mkdir(File dir)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void mkdir(File dir) { if (dir.exists()) { if (!dir.isDirectory()) { dir.delete();// w ww . j av a 2s .c o m dir.mkdir(); } } else { mkdir(dir.getParentFile()); dir.mkdir(); } } }