Class NativeLibraryStorage

java.lang.Object
net.sourceforge.jnlp.cache.NativeLibraryStorage

public class NativeLibraryStorage extends 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 Details

    • NATIVE_LIBRARY_EXTENSIONS

      public static final String[] NATIVE_LIBRARY_EXTENSIONS
  • Constructor Details

    • NativeLibraryStorage

      public NativeLibraryStorage(ResourceTracker tracker)
  • Method Details

    • cleanupTemporaryFolder

      public void cleanupTemporaryFolder()
      Clean up our temporary folder if we created one.
    • addSearchDirectory

      public void addSearchDirectory(File directory)
      Adds the File to the search path of this NativeLibraryStorage when trying to find a native library
      Parameters:
      directory - directory to be added
    • getSearchDirectories

      public List<File> getSearchDirectories()
    • findLibrary

      public File findLibrary(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(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