Here you can find the source of makeDirs(String fileName)
public static boolean makeDirs(String fileName)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static boolean makeDirs(String fileName) { if (fileName == null || fileName.isEmpty()) { return false; }// w w w . j a v a2 s.c om String filePath = fileName.substring(0, fileName.lastIndexOf("/")); File folder = new File(filePath); return (folder.exists() && folder.isDirectory()) ? true : folder.mkdirs(); } }