org.scijava.nativelib
Class BaseJniExtractor

java.lang.Object
  extended by org.scijava.nativelib.BaseJniExtractor
All Implemented Interfaces:
JniExtractor
Direct Known Subclasses:
DefaultJniExtractor, WebappJniExtractor

public abstract class BaseJniExtractor
extends Object
implements JniExtractor

Author:
Richard van der Hoff

Constructor Summary
BaseJniExtractor()
           
BaseJniExtractor(Class libraryJarClass)
           
 
Method Summary
 File extractJni(String libPath, String libname)
          Extract a JNI library from the classpath to a temporary file.
 void extractRegistered()
          Extract all libraries which are registered for auto-extraction to files in the temporary directory.
abstract  File getJniDir()
          this is where JNI libraries are extracted to (e.g.
abstract  File getNativeDir()
          this is where native dependencies are extracted to (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseJniExtractor

public BaseJniExtractor()
                 throws IOException
Throws:
IOException

BaseJniExtractor

public BaseJniExtractor(Class libraryJarClass)
                 throws IOException
Throws:
IOException
Method Detail

getNativeDir

public abstract File getNativeDir()
this is where native dependencies are extracted to (e.g. tmplib/).

Returns:
native working dir

getJniDir

public abstract File getJniDir()
this is where JNI libraries are extracted to (e.g. tmplib/classloaderName.1234567890000.0/).

Returns:
jni working dir

extractJni

public File extractJni(String libPath,
                       String libname)
                throws IOException
Extract a JNI library from the classpath to a temporary file.

Specified by:
extractJni in interface JniExtractor
Parameters:
libPath - library path
libname - System.loadLibrary() compatible library name
Returns:
the extracted file
Throws:
IOException

extractRegistered

public void extractRegistered()
                       throws IOException
Extract all libraries which are registered for auto-extraction to files in the temporary directory.

Specified by:
extractRegistered in interface JniExtractor
Throws:
IOException


Copyright © 2010–2014 SciJava. All rights reserved.