com.jogamp.common.util.cache
Class TempJarCache

java.lang.Object
  extended by com.jogamp.common.util.cache.TempJarCache

public class TempJarCache
extends Object


Nested Class Summary
static class TempJarCache.LoadState
           
 
Constructor Summary
TempJarCache()
           
 
Method Summary
static void addAll(Class<?> certClass, URI jarURI)
          Adds all types, native libraries, class files and other files (resources) if not yet added.
static void addClasses(Class<?> certClass, URI jarURI)
          Adds native classes, if not yet added.
static boolean addNativeLibs(Class<?> certClass, URI jarURI, String nativeLibraryPath)
          Adds native libraries, if not yet added.
static void addResources(Class<?> certClass, URI jarURI)
          Adds native resources, if not yet added.
static boolean checkClasses(URI jarURI, TempJarCache.LoadState exp)
           
static boolean checkNativeLibs(URI jarURI, TempJarCache.LoadState exp)
           
static boolean checkResources(URI jarURI, TempJarCache.LoadState exp)
           
static String findLibrary(String libName)
           
static String findResource(String name)
          Similar to ClassLoader.getResource(String).
static URI getResource(String name)
          Similar to ClassLoader.getResource(String).
static TempFileCache getTempFileCache()
           
static boolean initSingleton()
          Documented way to kick off static initialization.
static boolean isInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TempJarCache

public TempJarCache()
Method Detail

initSingleton

public static boolean initSingleton()
Documented way to kick off static initialization.

Returns:
true is static initialization was successful

isInitialized

public static boolean isInitialized()
Returns:
true if this class has been properly initialized, ie. is in use, otherwise false.

getTempFileCache

public static TempFileCache getTempFileCache()

checkNativeLibs

public static boolean checkNativeLibs(URI jarURI,
                                      TempJarCache.LoadState exp)
                               throws IOException
Throws:
IOException

checkClasses

public static boolean checkClasses(URI jarURI,
                                   TempJarCache.LoadState exp)
                            throws IOException
Throws:
IOException

checkResources

public static boolean checkResources(URI jarURI,
                                     TempJarCache.LoadState exp)
                              throws IOException
Throws:
IOException

addNativeLibs

public static final boolean addNativeLibs(Class<?> certClass,
                                          URI jarURI,
                                          String nativeLibraryPath)
                                   throws IOException,
                                          SecurityException,
                                          IllegalArgumentException,
                                          URISyntaxException
Adds native libraries, if not yet added.

Parameters:
certClass - if class is certified, the JarFile entries needs to have the same certificate
jarURI -
nativeLibraryPath - if not null, only extracts native libraries within this path.
Returns:
true if native libraries were added or previously loaded from given jarURI, otherwise false
Throws:
IOException - if the jarURI could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException

addClasses

public static final void addClasses(Class<?> certClass,
                                    URI jarURI)
                             throws IOException,
                                    SecurityException,
                                    IllegalArgumentException,
                                    URISyntaxException
Adds native classes, if not yet added. TODO class access pending needs Classloader.defineClass(..) access, ie. own derivation - will do when needed ..

Parameters:
certClass - if class is certified, the JarFile entries needs to have the same certificate
jarURI -
Throws:
IOException - if the jarURI could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException

addResources

public static final void addResources(Class<?> certClass,
                                      URI jarURI)
                               throws IOException,
                                      SecurityException,
                                      IllegalArgumentException,
                                      URISyntaxException
Adds native resources, if not yet added.

Parameters:
certClass - if class is certified, the JarFile entries needs to have the same certificate
jarURI -
Throws:
IOException - if the jarURI could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException

addAll

public static final void addAll(Class<?> certClass,
                                URI jarURI)
                         throws IOException,
                                SecurityException,
                                IllegalArgumentException,
                                URISyntaxException
Adds all types, native libraries, class files and other files (resources) if not yet added. TODO class access pending needs Classloader.defineClass(..) access, ie. own derivation - will do when needed ..

Parameters:
certClass - if class is certified, the JarFile entries needs to have the same certificate
jarURI -
Throws:
IOException - if the jarURI could not be loaded or a previous load attempt failed
SecurityException
URISyntaxException
IllegalArgumentException

findLibrary

public static final String findLibrary(String libName)

findResource

public static final String findResource(String name)
Similar to ClassLoader.getResource(String).


getResource

public static final URI getResource(String name)
                             throws URISyntaxException
Similar to ClassLoader.getResource(String).

Throws:
URISyntaxException