Package net.sourceforge.jnlp.cache
Class NativeLibraryStorage
- java.lang.Object
-
- net.sourceforge.jnlp.cache.NativeLibraryStorage
-
public class NativeLibraryStorage extends java.lang.Object
Handles loading and access of native code loading through a JNLP application or applet. Stores native code in a temporary folder. Be sure to call cleanupTemporayFolder when finished with the object.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
NATIVE_LIBRARY_EXTENSIONS
-
Constructor Summary
Constructors Constructor Description NativeLibraryStorage(ResourceTracker tracker)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSearchDirectory(java.io.File directory)
Adds theFile
to the search path of thisNativeLibraryStorage
when trying to find a native libraryvoid
addSearchJar(java.net.URL jarLocation)
Search for and enable any native code contained in a JAR by copying the native files into the filesystem.void
cleanupTemporaryFolder()
Clean up our temporary folder if we created one.java.io.File
findLibrary(java.lang.String fileName)
Looks in the search directories for 'fileName', returning a path to the found file if it exists.java.util.List<java.io.File>
getSearchDirectories()
-
-
-
Constructor Detail
-
NativeLibraryStorage
public NativeLibraryStorage(ResourceTracker tracker)
-
-
Method Detail
-
cleanupTemporaryFolder
public void cleanupTemporaryFolder()
Clean up our temporary folder if we created one.
-
addSearchDirectory
public void addSearchDirectory(java.io.File directory)
Adds theFile
to the search path of thisNativeLibraryStorage
when trying to find a native library- Parameters:
directory
- directory to be added
-
getSearchDirectories
public java.util.List<java.io.File> getSearchDirectories()
-
findLibrary
public java.io.File findLibrary(java.lang.String fileName)
Looks in the search directories for 'fileName', returning a path to the found file if it exists.- Parameters:
fileName
- name of library to be found- Returns:
- path to library if found, null otherwise.
-
addSearchJar
public void addSearchJar(java.net.URL jarLocation)
Search for and enable any native code contained in a JAR by copying the native files into the filesystem. Called in the security context of the classloader.- Parameters:
jarLocation
- location of jar to be searched
-
-