Here you can find the source of createRandomFolder(Path basePath)
public static Path createRandomFolder(Path basePath) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { private static int FOLDER_NUMBER = 0; public static Path createRandomFolder(Path basePath) throws IOException { String folderName = "f" + FOLDER_NUMBER++; Path p = basePath.resolve(folderName); Files.createDirectory(p); return p; }// w ww .j a v a2 s .c o m }