Skip to content

Commit 8285767

Browse files
committed
NativeDynamicLibrary: applied API changes
1 parent 55e1c73 commit 8285767

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

snaploader/src/main/java/electrostatic4j/snaploader/platform/NativeDynamicLibrary.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import java.io.File;
3636
import electrostatic4j.snaploader.LibraryInfo;
3737
import electrostatic4j.snaploader.NativeBinaryLoader;
38+
import electrostatic4j.snaploader.filesystem.DirectoryPath;
3839
import electrostatic4j.snaploader.platform.util.NativeVariant;
3940
import electrostatic4j.snaploader.platform.util.PlatformPredicate;
4041
import electrostatic4j.snaploader.platform.util.PropertiesProvider;
@@ -69,7 +70,7 @@ public class NativeDynamicLibrary {
6970
* A designator for the extraction directory of the
7071
* native library.
7172
*/
72-
protected String extractionDir;
73+
protected DirectoryPath directoryPath;
7374

7475
/**
7576
* The platform-specific predicate; that if evaluated as
@@ -137,7 +138,7 @@ public void initWithLibraryInfo(LibraryInfo libraryInfo) {
137138
jarPath = libraryInfo.getJarPath();
138139

139140
/* Initializes the library with an extraction path, "null" to extract to the current user directory */
140-
extractionDir = libraryInfo.getExtractionDir();
141+
directoryPath = libraryInfo.getExtractionDirectory();
141142

142143
/* Fallback initializes the library directory within the jar from the library-info */
143144
if (platformDirectory == null) {
@@ -178,11 +179,8 @@ public String getCompressedLibrary() {
178179
* @return the absolute path composed of the extraction directory and the library name and system-specific extension
179180
*/
180181
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;
186184
}
187185

188186
/**

0 commit comments

Comments
 (0)