public boolean load ( String name , boolean verify ) { boolean loaded = false ; try { Platform platform = Platform . detect ( ) ; JarFile jar = new JarFile ( codeSource . getLocation ( ) . getPath ( ) , verify ) ; try { for ( String path : libCandidates ( platform , name ) ) { JarEntry entry = jar . getJarEntry ( path ) ; if ( entry == null ) continue ; File lib = extract ( name , jar . getInputStream ( entry ) ) ; System . load ( lib . getAbsolutePath ( ) ) ; lib . delete ( ) ; loaded = true ; break ; } } finally { jar . close ( ) ; } } catch ( Throwable e ) { loaded = false ; } return loaded ; }
Load a shared library and optionally verify the jar signatures .