Here you can find the source of mkDir(File file)
private static void mkDir(File file)
//package com.java2s; import java.io.File; public class Main { private static void mkDir(File file) { if (file.getParentFile().exists()) { file.mkdir();/* ww w .ja v a 2 s.co m*/ } else { mkDir(file.getParentFile()); file.mkdir(); } } }