Skip to content

Commit

Permalink
NativeBinaryLoader: optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
pavly-gerges committed Aug 7, 2024
1 parent d140d9e commit 100aad7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,10 @@ public void onExtractionFinalization(FileExtractor fileExtractor, FileLocator fi
protected FileExtractor initializeLibraryExtractor(NativeDynamicLibrary library) throws Exception {
FileExtractor extractor;
if (library.getJarPath() != null) {
// use an extractor with the external jar routine
extractor = new LibraryExtractor(new JarFile(library.getJarPath()), library.getCompressedLibrary(), library.getExtractedLibrary());
} else {
// use an extractor with the classpath routine
extractor = new LibraryExtractor(library.getCompressedLibrary(), library.getExtractedLibrary());
}
extractor.initialize(0);
Expand All @@ -364,7 +366,7 @@ protected LibraryLocator preInitLibraryLocator(FileExtractor extractor) {
extractor.getFileLocator().setFileLocalizingListener(new FileLocalizingListener() {
@Override
public void onFileLocalizationSuccess(FileLocator locator) {
SnapLoaderLogger.log(Level.INFO, getClass().getName(), "initializeLibraryExtractor",
SnapLoaderLogger.log(Level.INFO, getClass().getName(), "preInitLibraryLocator",
"Locating native libraries has succeeded!");

// bind the library locator lifecycle to the user application
Expand All @@ -375,7 +377,7 @@ public void onFileLocalizationSuccess(FileLocator locator) {

@Override
public void onFileLocalizationFailure(FileLocator locator, Throwable throwable) {
SnapLoaderLogger.log(Level.SEVERE, getClass().getName(), "initializeLibraryExtractor",
SnapLoaderLogger.log(Level.SEVERE, getClass().getName(), "preInitLibraryLocator",
"Locating native libraries has failed!", throwable);
try {
extractor.close();
Expand Down

0 comments on commit 100aad7

Please sign in to comment.