changeset 52564:300523d8b7b3

8210802: temp files left by tests in jdk/java/net/httpclient Reviewed-by: chegar, clanger
author mli
date Tue, 18 Sep 2018 13:24:25 +0800
parents 9c6d5e31618e
children 1740b162dc0e
files test/jdk/java/net/httpclient/EchoHandler.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();