8210802: temp files left by tests in jdk/java/net/httpclient
authormli
Tue, 18 Sep 2018 13:24:25 +0800
changeset 51778 300523d8b7b3
parent 51777 9c6d5e31618e
child 51779 1740b162dc0e
8210802: temp files left by tests in jdk/java/net/httpclient Reviewed-by: chegar, clanger
test/jdk/java/net/httpclient/EchoHandler.java
--- 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();