Package jssc
Class DefaultJniExtractorStub
- java.lang.Object
-
- org.scijava.nativelib.BaseJniExtractor
-
- org.scijava.nativelib.DefaultJniExtractor
-
- jssc.DefaultJniExtractorStub
-
- All Implemented Interfaces:
org.scijava.nativelib.JniExtractor
public class DefaultJniExtractorStub extends org.scijava.nativelib.DefaultJniExtractor- Author:
- A. Tres Finocchiaro
Stub
DefaultJniExtractorclass to allow native-lib-loader to conditionally use a statically defined native search pathbootPathwhen provided.
-
-
Constructor Summary
Constructors Constructor Description DefaultJniExtractorStub(Class<?> libraryJarClass)Default constructorDefaultJniExtractorStub(Class<?> libraryJarClass, String bootPath)Force native-lib-loader to first look in the location defined asbootPathprior to extracting a native library, useful for sandboxed environments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileextractJni(String libPath, String libName)If abootPathwas provided to the constructor and exists, calculate theFilepath without any extraction logic.voidextractRegistered()
-
-
-
Constructor Detail
-
DefaultJniExtractorStub
public DefaultJniExtractorStub(Class<?> libraryJarClass) throws IOException
Default constructor- Throws:
IOException
-
DefaultJniExtractorStub
public DefaultJniExtractorStub(Class<?> libraryJarClass, String bootPath) throws IOException
Force native-lib-loader to first look in the location defined asbootPathprior to extracting a native library, useful for sandboxed environments.NativeLoader.setJniExtractor(new DefaultJniExtractorStub(null, "/opt/nativelibs"))); NativeLoader.loadLibrary("mylibrary");- Throws:
IOException
-
-
Method Detail
-
extractJni
public File extractJni(String libPath, String libName) throws IOException
If abootPathwas provided to the constructor and exists, calculate theFilepath without any extraction logic. If abootPathwas NOT provided or does NOT exist, fallback on the default extraction behavior.- Specified by:
extractJniin interfaceorg.scijava.nativelib.JniExtractor- Overrides:
extractJniin classorg.scijava.nativelib.BaseJniExtractor- Throws:
IOException
-
extractRegistered
public void extractRegistered() throws IOException- Specified by:
extractRegisteredin interfaceorg.scijava.nativelib.JniExtractor- Overrides:
extractRegisteredin classorg.scijava.nativelib.BaseJniExtractor- Throws:
IOException
-
-