Here you can find the source of createDirectoryRecursively(String dirName)
public static void createDirectoryRecursively(String dirName) throws IOException
//package com.java2s; //License from project: BSD License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void createDirectoryRecursively(String dirName) throws IOException { Path newDirectoryPath = Paths.get(dirName); if (Files.exists(newDirectoryPath)) { throw new java.nio.file.FileAlreadyExistsException("directory " + dirName + " already exists"); }/*from w w w. j a v a 2 s. co m*/ Files.createDirectories(newDirectoryPath); } }