@@ -88,6 +88,7 @@ public class Loader
8888 private static List <String > loadedLibs = new ArrayList <>();
8989 private static boolean extractOpenSSL = true ;
9090 private static boolean fixedInstallDir = false ;
91+ private static String installDir ;
9192
9293 public static void load ()
9394 {
@@ -123,11 +124,11 @@ private static void loadImpl()
123124 extractOpenSSL = Properties .isOverrideSet (OPENSSL_EXTRACT , true );
124125 interfaceResolutionStrategy = Strings .toLowerCase (Properties .getPropertyValue (LOADER_INTERFACE , "auto" ));
125126
126- String libDir = Properties .getPropertyValue (LIB_INSTALL_DIR );
127- if (libDir == null )
127+ installDir = Properties .getPropertyValue (LIB_INSTALL_DIR );
128+ if (installDir == null )
128129 {
129130 L .fine (String .format ("%s is not set so using java.io.tmpdir property" , LIB_INSTALL_DIR ));
130- libDir = Properties .getPropertyValue ("java.io.tmpdir" );
131+ installDir = Properties .getPropertyValue ("java.io.tmpdir" );
131132 } else
132133 {
133134 fixedInstallDir = true ;
@@ -136,7 +137,7 @@ private static void loadImpl()
136137 //
137138 // Unable to resolve a temporary directory root!
138139 //
139- if (libDir == null )
140+ if (installDir == null )
140141 {
141142 throw new IOException ("Unable to resolve a temporary directory" );
142143 }
@@ -282,7 +283,7 @@ private static void loadImpl()
282283 {
283284 String version = JostleProvider .INFO .substring (JostleProvider .INFO .lastIndexOf ('v' ) + 1 );
284285
285- installRootDir = LoaderUtils .createVersionedTempDir (libDir , version );
286+ installRootDir = LoaderUtils .createVersionedTempDir (installDir , version );
286287 } else
287288 {
288289 installRootDir = LoaderUtils .createTempDir ("jostle" );
@@ -383,7 +384,8 @@ private static void extractAndLoad(File installRootDir, String libRootInJar, Ext
383384 throws Exception
384385 {
385386 String pathInJar = libRootInJar + "/" + extraction .name ;
386- File libFile = LoaderUtils .extractFromClasspath (installRootDir , pathInJar , extraction .name );
387+ String [] sources = new String [2 ];
388+ File libFile = LoaderUtils .extractFromClasspath (installRootDir , pathInJar , extraction .name , sources );
387389 if (libFile == null )
388390 {
389391 throw new IOException (String .format ("extraction file '%s' not found" , pathInJar ));
@@ -392,7 +394,16 @@ private static void extractAndLoad(File installRootDir, String libRootInJar, Ext
392394 L .fine (String .format ("Wrote %s to %s, %d bytes" , extraction .name , libFile .getAbsoluteFile (), libFile .length ()));
393395 }
394396 System .load (libFile .getAbsolutePath ());
395- loadedLibs .add ("Extracted: " + pathInJar );
397+
398+
399+ if (sources [0 ] != null && sources [1 ] != null )
400+ {
401+ loadedLibs .add ("Loaded: " + sources [1 ]);
402+ loadedLibs .add (" Compared to: " + sources [0 ]);
403+ } else
404+ {
405+ loadedLibs .add ("Extracted: " + sources [0 ]);
406+ }
396407 }
397408
398409 /**
@@ -463,6 +474,15 @@ public static boolean isFFI()
463474 return Extractions .Type .FFI == interfaceType ;
464475 }
465476
477+ public static String getInstallDir ()
478+ {
479+ return installDir ;
480+ }
481+
482+ public static boolean isFixedInstallDir () {
483+ return fixedInstallDir ;
484+ }
485+
466486 private static class Extractions
467487 {
468488
0 commit comments