Here you can find the source of forceMkdir(File directory)
public static void forceMkdir(File directory) throws IOException
//package com.java2s; import java.io.File; import java.io.IOException; public class Main { public static void forceMkdir(File directory) throws IOException { if (directory.exists()) { if (directory.isFile()) { String message = "File " + directory + " exists and is " + "not a directory. Unable to create directory."; throw new IOException(message); }//from www . j a v a 2 s . c o m } else { if (false == directory.mkdirs()) { String message = "Unable to create directory " + directory; throw new IOException(message); } } } }