Here you can find the source of mkdir(String filePath)
public static void mkdir(String filePath)
//package com.java2s; import java.io.File; public class Main { public static void mkdir(String filePath) { StringBuffer path = new StringBuffer(); String[] fileList = filePath.split("/"); path.append(fileList[0]);//from w w w . ja v a 2 s . co m File rootfile = new File(path.toString()); rootfile.mkdir(); for (int i = 1; i < fileList.length; i++) { path.append("/").append(fileList[i]); File file = new File(path.toString()); file.mkdir(); } } }