Here you can find the source of createDirs(String dir, boolean ignoreIfExitst)
public static void createDirs(String dir, boolean ignoreIfExitst) throws IOException
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { public static void createDirs(String dir, boolean ignoreIfExitst) throws IOException { File file = new File(dir); if (ignoreIfExitst && file.exists()) { return; }//from w w w . j a va 2s . com if (file.mkdirs() == false) { throw new IOException("Cannot create directories = " + dir); } } }