From 552eb95c44dd99d3d1234278e8113f915852f133 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Mon, 21 Nov 2022 07:49:18 +0900 Subject: [PATCH] Fix Files name collision Regression from b282b5cbfef760be026660522e78d1bba81988ac. --- .../http/BaseHttpCommandExecutorServiceIntegrationTest.java | 3 +-- .../jclouds/rest/internal/RestAnnotationProcessorTest.java | 5 ++--- .../java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java | 3 +-- .../test/java/org/jclouds/sshj/SshjSshClientLiveTest.java | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java b/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java index e9ce28ab7d..cb406d60d2 100644 --- a/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java +++ b/core/src/test/java/org/jclouds/http/BaseHttpCommandExecutorServiceIntegrationTest.java @@ -31,7 +31,6 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLDecoder; -import java.nio.file.Files; import java.util.Random; import java.util.concurrent.TimeUnit; @@ -269,7 +268,7 @@ public abstract class BaseHttpCommandExecutorServiceIntegrationTest extends Base Payload payload = null; try { - f = Files.createTempFile("jclouds", "tmp").toFile(); + f = java.nio.file.Files.createTempFile("jclouds", "tmp").toFile(); long length = (new Random().nextInt(32) + 1) * 1024L * 1024L; TestUtils.randomByteSource().slice(0, length).copyTo(Files.asByteSink(f)); diff --git a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java index 666b7e1854..5ace972bef 100644 --- a/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java +++ b/core/src/test/java/org/jclouds/rest/internal/RestAnnotationProcessorTest.java @@ -43,7 +43,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.net.URI; import java.net.URLEncoder; -import java.nio.file.Files; import java.security.NoSuchAlgorithmException; import java.util.Arrays; import java.util.Collection; @@ -1037,7 +1036,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { public void testMultipartWithParamFilePart() throws Exception { Invokable method = method(TestMultipartForm.class, "withParamFilePart", String.class, File.class); - File file = Files.createTempFile("foo", "bar").toFile(); + File file = java.nio.file.Files.createTempFile("foo", "bar").toFile(); try { Files.append("foobledata", file, UTF_8); @@ -1083,7 +1082,7 @@ public class RestAnnotationProcessorTest extends BaseRestApiTest { public void testMultipartWithParamFileBinaryPart() throws Exception { Invokable method = method(TestMultipartForm.class, "withParamFileBinaryPart", String.class, File.class); - File file = Files.createTempFile("foo", "bar").toFile(); + File file = java.nio.file.Files.createTempFile("foo", "bar").toFile(); try { Files.write(new byte[] { 17, 26, 39, 40, 50 }, file); diff --git a/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java b/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java index 64007c299e..d9389cd67d 100644 --- a/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java +++ b/drivers/jsch/src/test/java/org/jclouds/ssh/jsch/JschSshClientLiveTest.java @@ -28,7 +28,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.net.InetAddress; -import java.nio.file.Files; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.Executors; @@ -162,7 +161,7 @@ public class JschSshClientLiveTest { @Test public void testPutAndGet() throws IOException { - temp = Files.createTempFile("foo", "bar").toFile(); + temp = java.nio.file.Files.createTempFile("foo", "bar").toFile(); try { SshClient client = setupClient(); client.put(temp.getAbsolutePath(), Payloads.newStringPayload("rabbit")); diff --git a/drivers/sshj/src/test/java/org/jclouds/sshj/SshjSshClientLiveTest.java b/drivers/sshj/src/test/java/org/jclouds/sshj/SshjSshClientLiveTest.java index fe664ce283..0d9ebc30d5 100644 --- a/drivers/sshj/src/test/java/org/jclouds/sshj/SshjSshClientLiveTest.java +++ b/drivers/sshj/src/test/java/org/jclouds/sshj/SshjSshClientLiveTest.java @@ -26,7 +26,6 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintStream; import java.net.InetAddress; -import java.nio.file.Files; import org.jclouds.compute.domain.ExecChannel; import org.jclouds.compute.domain.ExecResponse; @@ -149,7 +148,7 @@ public class SshjSshClientLiveTest { } public void testPutAndGet() throws IOException { - temp = Files.createTempFile("foo", "bar").toFile(); + temp = java.nio.file.Files.createTempFile("foo", "bar").toFile(); try { SshClient client = setupClient(); client.put(temp.getAbsolutePath(), Payloads.newStringPayload("rabbit"));