Here you can find the source of makePath(String basePath)
static public void makePath(String basePath)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**//from w w w . j a v a 2 s . c o m * Makes folders along the specified path */ static public void makePath(String basePath) { File path = new File(basePath); try { if (!path.exists()) { if (!path.mkdirs()) //Did someone sneaky make it? if (!path.exists()) throw new RuntimeException("Failed to create directory:" + basePath); } else if (!path.isDirectory()) { throw new RuntimeException("Something is already has this name, and it's not a dir: " + basePath); } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("Failed to create directory:" + basePath); } } }