Java tutorial
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /** * utility method to create a folder * * @param path full path to create * @return {@link File} object of the folder just created * @throws IOException */ private static File createFolder(String path) throws IOException { File file = new File(path); if (!file.exists()) { if (!file.mkdir()) { throw new IOException("couldn't create folder '" + path + "'"); } } return file; } }