Here you can find the source of createDirectoriesIfNotExists(Path path)
static public Path createDirectoriesIfNotExists(Path path) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { static public Path createDirectoriesIfNotExists(Path path) throws IOException { if (Files.exists(path)) { return path; }//w ww .jav a 2 s . c o m return Files.createDirectories(path); } }