Here you can find the source of mkdirs(File file)
public static boolean mkdirs(File file)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { /**/*from w w w .ja v a 2s .c o m*/ * Create all directories, including nonexistent parent directories. */ public static boolean mkdirs(File file) { if (file != null) { String parent = file.getParent(); if (parent != null) { File parentDir = new File(parent); if (!parentDir.exists()) { return parentDir.mkdirs(); } } return true; } return false; } }