Here you can find the source of makeTempFilePath(boolean exists)
public static Path makeTempFilePath(boolean exists) 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; import java.nio.file.Paths; public class Main { public static Path makeTempFilePath(boolean exists) throws IOException { Path result;/*ww w. j ava2 s .c om*/ if (System.getenv().containsKey("TEST_TMPDIR")) { result = Files.createTempFile(Paths.get(System.getenv("TEST_TMPDIR")), "", "json"); } else { result = Files.createTempFile("", "json"); } if (!exists) { Files.delete(result); } return result; } }