Skip to content

Commit 877fe08

Browse files
committed
library-api: applied API changes
1 parent 855a2cb commit 877fe08

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

snaploader/src/main/java/electrostatic4j/snaploader/library/LibraryExtractor.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
package electrostatic4j.snaploader.library;
3434

3535
import java.io.IOException;
36+
import java.util.zip.ZipFile;
3637
import electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor;
3738
import electrostatic4j.snaploader.filesystem.FileExtractor;
3839

@@ -44,26 +45,26 @@
4445
public class LibraryExtractor extends ConcurrentFileExtractor {
4546

4647
/**
47-
* Instantiates a native dynamic library extractor with a jar path, library path and extract destination filesystem path.
48+
* Instantiates a native dynamic library extractor for an external compression file locator routine.
4849
*
49-
* @param jarPath an absolute path to the jar filesystem containing the library
50-
* @param libraryPath the path of the library inside the jar filesystem
50+
* @param compression the zip file object for external locator routines
51+
* @param libraryPath the path of the library inside the compression filesystem
5152
* @param destination the extraction destination filesystem path
5253
* @throws IOException if the jar filesystem to be located is not found, or if the extraction destination is not found
5354
*/
54-
public LibraryExtractor(String jarPath, String libraryPath, String destination) throws IOException {
55-
super(new LibraryLocator(jarPath, libraryPath), destination);
55+
public LibraryExtractor(ZipFile compression, String libraryPath, String destination) throws IOException {
56+
super(new LibraryLocator(compression, libraryPath), destination);
5657
}
5758

5859
/**
5960
* Instantiates a native dynamic library extractor with a library path and an extract destination filesystem path. This
60-
* object locates a dynamic native library inside the stock jar filesystem based on a classpath input stream.
61+
* object locates a dynamic native library inside the stock jar filesystem based on a classpath input stream
62+
* (i.e., classpath file locator routine).
6163
*
6264
* @param libraryPath the path of the library inside the jar filesystem
6365
* @param destination the extraction destination filesystem path
64-
* @throws IOException if the jar filesystem to be located is not found, or if the extraction destination is not found
6566
*/
66-
public LibraryExtractor(String libraryPath, String destination) throws IOException {
67+
public LibraryExtractor(String libraryPath, String destination) {
6768
super(new LibraryLocator(libraryPath), destination);
6869
}
6970
}

snaploader/src/main/java/electrostatic4j/snaploader/library/LibraryLocator.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
package electrostatic4j.snaploader.library;
3434

3535
import java.io.IOException;
36-
import java.util.jar.JarFile;
3736
import java.util.zip.ZipEntry;
38-
import electrostatic4j.snaploader.filesystem.ZipCompressionType;
37+
import java.util.zip.ZipFile;
3938
import electrostatic4j.snaploader.filesystem.FileLocator;
4039

4140
/**
@@ -47,7 +46,6 @@ public class LibraryLocator extends FileLocator {
4746

4847
/**
4948
* Locates the library inside the stock jar filesystem.
50-
* This object leaks an input stream.
5149
*
5250
* @param libraryPath the path to the dynamic native library inside that jar filesystem
5351
*/
@@ -56,15 +54,12 @@ public LibraryLocator(String libraryPath) {
5654
}
5755

5856
/**
59-
* Locates a library inside an external jar, the external jar is defined by the means of a {@link JarFile} and
60-
* the native library is defined as a {@link ZipEntry}.
61-
* This object leaks an input stream.
62-
*
63-
* @param directory the absolute path for the external jar filesystem
64-
* @param libraryPath the path to the dynamic native library inside that jar filesystem
65-
* @throws IOException if the jar to be located is not found or an interrupt I/O operation has occured
57+
* Locates a library inside an external jar, the external jar is defined by the means of a {@link ZipFile} and
58+
* the native library is defined as a {@link ZipEntry}.
59+
*
60+
* @throws IOException if the jar to be located is not found or an interrupt I/O operation has occurred.
6661
*/
67-
public LibraryLocator(String directory, String libraryPath) throws IOException {
68-
super(directory, libraryPath, ZipCompressionType.JAR);
62+
public LibraryLocator(ZipFile compression, String filePath) throws IOException {
63+
super(compression, filePath);
6964
}
7065
}

0 commit comments

Comments
 (0)