Here you can find the source of makeDirs(File file)
public static void makeDirs(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static void makeDirs(File file) { file = new File(file.getAbsolutePath()); File parent = file.getParentFile(); if (!parent.exists()) makeDirs(parent);//from w ww . ja v a 2 s . c om parent.mkdir(); } }