Here you can find the source of mkdir(String dir)
public static boolean mkdir(String dir)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { /**/*from w w w . j av a2s . com*/ * Create a directory, if it does not exist. */ public static boolean mkdir(String dir) { if (!exists(dir)) { return (new File(dir)).mkdirs(); } else { return isDirectory(dir); } } /** * Check if a file exists. */ public static boolean exists(String file) { return (new File(file)).exists(); } /** * Check if the argument is a directory. */ public static boolean isDirectory(String dir) { return (new File(dir)).isDirectory(); } }