Package jssc

Class DefaultJniExtractorStub

  • All Implemented Interfaces:
    org.scijava.nativelib.JniExtractor

    public class DefaultJniExtractorStub
    extends org.scijava.nativelib.DefaultJniExtractor
    Author:
    A. Tres Finocchiaro Stub DefaultJniExtractor class to allow native-lib-loader to conditionally use a statically defined native search path bootPath when provided.
    • 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 as bootPath prior 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 a bootPath was provided to the constructor and exists, calculate the File path without any extraction logic. If a bootPath was NOT provided or does NOT exist, fallback on the default extraction behavior.
        Specified by:
        extractJni in interface org.scijava.nativelib.JniExtractor
        Overrides:
        extractJni in class org.scijava.nativelib.BaseJniExtractor
        Throws:
        IOException
      • extractRegistered

        public void extractRegistered()
                               throws IOException
        Specified by:
        extractRegistered in interface org.scijava.nativelib.JniExtractor
        Overrides:
        extractRegistered in class org.scijava.nativelib.BaseJniExtractor
        Throws:
        IOException