8210802: temp files left by tests in jdk/java/net/httpclient
Reviewed-by: chegar, clanger
--- a/test/jdk/java/net/httpclient/EchoHandler.java Mon Sep 17 23:35:00 2018 -0400
+++ b/test/jdk/java/net/httpclient/EchoHandler.java Tue Sep 18 13:24:25 2018 +0800
@@ -40,6 +40,7 @@
import java.util.logging.Logger;
public class EchoHandler implements HttpHandler {
+ static final Path CWD = Paths.get(".");
public EchoHandler() {}
@Override
@@ -53,7 +54,7 @@
map1.add("X-Hello", "world");
map1.add("X-Bye", "universe");
String fixedrequest = map.getFirst("XFixed");
- File outfile = File.createTempFile("foo", "bar");
+ File outfile = Files.createTempFile(CWD, "foo", "bar").toFile();
FileOutputStream fos = new FileOutputStream(outfile);
int count = (int) is.transferTo(fos);
is.close();