Here you can find the source of mkdir(File file)
public static boolean mkdir(File file)
//package com.java2s; /*/* w ww.ja v a 2s . c o m*/ * Copyright (c) 2006-07, The Trustees of Stanford University. All * rights reserved. * Licensed under the terms of the GNU GPL; see COPYING for details. */ import java.io.File; public class Main { public static boolean mkdir(String dirName) { return mkdir(new File(dirName)); } public static boolean mkdir(String parentName, String childName) { return mkdir(new File(parentName, childName)); } public static boolean mkdir(File file) { if (file.exists()) { assertIsDir(file); return false; } if (file.mkdirs()) return true; throw new RuntimeException("Failed to create directory '" + file + "'"); } public static void assertIsDir(File file) { if (!file.isDirectory()) { throw new RuntimeException("File '" + file + "' is not a directory."); } } }