|
15 | 15 | *--------------------------------------------------------------------------*/
|
16 | 16 | package org.fusesource.jansi.internal;
|
17 | 17 |
|
18 |
| -import java.io.BufferedOutputStream; |
19 | 18 | import java.io.File;
|
20 | 19 | import java.io.FileInputStream;
|
21 | 20 | import java.io.FileOutputStream;
|
|
28 | 27 | import java.util.LinkedList;
|
29 | 28 | import java.util.List;
|
30 | 29 | import java.util.Properties;
|
31 |
| -import java.util.UUID; |
| 30 | +import java.util.Random; |
32 | 31 |
|
33 | 32 | /**
|
34 | 33 | * Set the system properties, org.jansi.lib.path, org.jansi.lib.name,
|
@@ -162,7 +161,7 @@ private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, S
|
162 | 161 | String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
|
163 | 162 | // Include architecture name in temporary filename in order to avoid conflicts
|
164 | 163 | // when multiple JVMs with different architectures running at the same time
|
165 |
| - String uuid = UUID.randomUUID().toString(); |
| 164 | + String uuid = randomUUID(); |
166 | 165 | String extractedLibFileName = String.format("jansi-%s-%s-%s", getVersion(), uuid, libraryFileName);
|
167 | 166 | String extractedLckFileName = extractedLibFileName + ".lck";
|
168 | 167 |
|
@@ -221,6 +220,10 @@ private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, S
|
221 | 220 | return false;
|
222 | 221 | }
|
223 | 222 |
|
| 223 | + private static String randomUUID() { |
| 224 | + return Long.toHexString(new Random().nextLong()); |
| 225 | + } |
| 226 | + |
224 | 227 | private static void copy(InputStream in, OutputStream out) throws IOException {
|
225 | 228 | byte[] buf = new byte[8192];
|
226 | 229 | int n;
|
|
0 commit comments