Java examples for File Path IO:File Operation
Create a sequence of hierarchical directories
import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static void main(String[] args) { Path newdir = FileSystems.getDefault().getPath("C:/folder1/", "statistics/win/prizes"); try {/*from w w w. java 2 s .c o m*/ Files.createDirectories(newdir); } catch (IOException e) { System.err.println(e); } } }