Java examples for File Path IO:File Permission
Create a temporary directory
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 basedir = FileSystems.getDefault().getPath("C:/folder1/tmp/"); String tmp_dir_prefix = "test_"; try {//w ww. j a v a 2 s . c o m // create a tmp directory in the base dir Path tmp = Files.createTempDirectory(basedir, tmp_dir_prefix); System.out.println("TMP: " + tmp.toString()); } catch (IOException e) { System.err.println(e); } } }