创建一个临时目录
import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; /** from * 时代Java公众号 - nowjava.com **/ public class Main { public static void main(String[] args) { Path basedir = FileSystems.getDefault().getPath("C:/folder1/tmp/"); String tmp_dir_prefix = "test_"; try { // create a tmp directory in the base dir Path tmp = Files.createTempDirectory(basedir, tmp_dir_prefix); System.out.println("TMP: "