Here you can find the source of mkdir(String dirPath, boolean del)
public static void mkdir(String dirPath, boolean del)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static void mkdir(String dirPath, boolean del) { File dir = new File(dirPath); if (dir.exists()) { if (del) dir.delete();/*from ww w. java 2 s .c o m*/ else return; } if (!dir.getParentFile().exists()) { dir.getParentFile().mkdirs(); } } }