|
35 | 35 | import java.io.File; |
36 | 36 | import electrostatic4j.snaploader.LibraryInfo; |
37 | 37 | import electrostatic4j.snaploader.NativeBinaryLoader; |
| 38 | +import electrostatic4j.snaploader.filesystem.DirectoryPath; |
38 | 39 | import electrostatic4j.snaploader.platform.util.NativeVariant; |
39 | 40 | import electrostatic4j.snaploader.platform.util.PlatformPredicate; |
40 | 41 | import electrostatic4j.snaploader.platform.util.PropertiesProvider; |
@@ -69,7 +70,7 @@ public class NativeDynamicLibrary { |
69 | 70 | * A designator for the extraction directory of the |
70 | 71 | * native library. |
71 | 72 | */ |
72 | | - protected String extractionDir; |
| 73 | + protected DirectoryPath directoryPath; |
73 | 74 |
|
74 | 75 | /** |
75 | 76 | * The platform-specific predicate; that if evaluated as |
@@ -137,7 +138,7 @@ public void initWithLibraryInfo(LibraryInfo libraryInfo) { |
137 | 138 | jarPath = libraryInfo.getJarPath(); |
138 | 139 |
|
139 | 140 | /* Initializes the library with an extraction path, "null" to extract to the current user directory */ |
140 | | - extractionDir = libraryInfo.getExtractionDir(); |
| 141 | + directoryPath = libraryInfo.getExtractionDirectory(); |
141 | 142 |
|
142 | 143 | /* Fallback initializes the library directory within the jar from the library-info */ |
143 | 144 | if (platformDirectory == null) { |
@@ -178,11 +179,8 @@ public String getCompressedLibrary() { |
178 | 179 | * @return the absolute path composed of the extraction directory and the library name and system-specific extension |
179 | 180 | */ |
180 | 181 | public String getExtractedLibrary() { |
181 | | - if (extractionDir != null) { |
182 | | - return extractionDir + PropertiesProvider.FILE_SEPARATOR.getSystemProperty() + libraryFile; |
183 | | - } |
184 | | - return PropertiesProvider.USER_DIR.getSystemProperty() + |
185 | | - PropertiesProvider.FILE_SEPARATOR.getSystemProperty() + libraryFile; |
| 182 | + return directoryPath.getPath() |
| 183 | + + PropertiesProvider.FILE_SEPARATOR.getSystemProperty() + libraryFile; |
186 | 184 | } |
187 | 185 |
|
188 | 186 | /** |
|
0 commit comments