Java tutorial
//package com.java2s; import java.io.File; public class Main { public static File createDir(String dirPath) { File dirFile = new File(dirPath); if (!dirFile.exists() || !dirFile.isDirectory()) { boolean success = dirFile.mkdirs(); if (!success) { return null; } } return dirFile; } }