Java tutorial
//package com.java2s; import java.io.File; public class Main { public static void mkFile(String filePath, boolean mkdir) throws Exception { File file = new File(filePath); file.getParentFile().mkdirs(); file.createNewFile(); file = null; } }