Here you can find the source of forceMkdir(File dir)
public static void forceMkdir(File dir) throws IOException
//package com.java2s; //it under the terms of the GNU Affero General Public License as published by import java.io.File; import java.io.IOException; public class Main { public static void forceMkdir(File dir) throws IOException { boolean success = dir.isDirectory(); if (!success) { success = dir.mkdirs();/* w w w .j av a2s. c o m*/ } checkSuccess(success, "Cannot create directory " + dir); } private static void checkSuccess(boolean success, String message) throws IOException { if (!success) { throw new IOException(message); } } }