public class Test {
public static void main(String[] args) { String strPath = "C://1/2/a/b/c/"; mkdir(strPath); } static String mkdir(String filePath) { File file = new File(filePath); System.out.println("file:" + file.getAbsolutePath()); if (!file.isDirectory()) { new File(mkdir(file.getParent())).mkdir(); } file.mkdir(); return filePath; }}