From 2e4178d8d6eab2f0673082bd90a45556965b74ce Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 18 Nov 2024 18:18:57 +0100 Subject: [PATCH] [openpgp] Use Files.createTempDirectory() instead of using a hardcoded path --- .../jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java index 4cc22b7c58..7a259886bc 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java @@ -21,6 +21,7 @@ import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.security.InvalidAlgorithmParameterException; import java.security.NoSuchAlgorithmException; import java.util.Collections; @@ -51,7 +52,11 @@ public class SecretKeyBackupHelperTest extends SmackTestSuite { private static final File basePath; static { - basePath = new File(org.apache.commons.io.FileUtils.getTempDirectory(), "ox_secret_keys"); + try { + basePath = Files.createTempDirectory("ox_secret_keys_").toFile(); + } catch (IOException e) { + throw new AssertionError(e); + } } @Test