Here you can find the source of makeDirs(String fileName, boolean hasFile)
public static boolean makeDirs(String fileName, boolean hasFile)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static boolean makeDirs(String fileName, boolean hasFile) { boolean result = false; if (hasFile) { int lastIndex = fileName.lastIndexOf('/'); if (lastIndex > -1) { String filePath = fileName.substring(0, lastIndex); if (filePath != null && !filePath.equals("")) { result = new File(filePath).mkdirs(); }// w w w . jav a2s.com } } else { result = new File(fileName).mkdirs(); } return result; } }