Here you can find the source of mkdirs(String packageName, File root)
public static File mkdirs(String packageName, File root)
//package com.java2s; import java.io.*; public class Main { public static File mkdirs(String packageName, File root) { String[] dirs = packageName.split("\\."); for (String dir : dirs) { File f = new File(root, dir); if (!f.exists()) { f.mkdir();/*from ww w .ja v a2 s . c o m*/ } root = f; } return root; } }