Package com.jogamp.common.util.cache
Class TempJarCache
- java.lang.Object
-
- com.jogamp.common.util.cache.TempJarCache
-
public class TempJarCache extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TempJarCache.LoadState
-
Constructor Summary
Constructors Constructor Description TempJarCache()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 void
addResources(Class<?> certClass, URI jarURI)
Deprecated.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 toClassLoader.getResource(String)
.static URI
getResource(String name)
Deprecated.static Uri
getResourceUri(String name)
Similar toClassLoader.getResource(String)
.static TempFileCache
getTempFileCache()
static boolean
initSingleton()
Documented way to kick off static initialization.static boolean
isInitialized()
-
-
-
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 certificatejarUri
-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 thejarUri
could not be loaded or a previous load attempt failedSecurityException
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 certificatejarUri
-- Throws:
IOException
- if thejarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
-
addResources
public static final void addResources(Class<?> certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
Deprecated.- Parameters:
certClass
-jarURI
-- Throws:
IOException
SecurityException
IllegalArgumentException
URISyntaxException
-
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 certificatejarUri
-- Throws:
IOException
- if thejarUri
could not be loaded or a previous load attempt failedSecurityException
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 certificatejarUri
-- Throws:
IOException
- if thejarUri
could not be loaded or a previous load attempt failedSecurityException
URISyntaxException
IllegalArgumentException
-
findResource
public static final String findResource(String name)
Similar toClassLoader.getResource(String)
.
-
getResource
public static final URI getResource(String name) throws URISyntaxException
Deprecated.- Throws:
URISyntaxException
-
getResourceUri
public static final Uri getResourceUri(String name) throws URISyntaxException
Similar toClassLoader.getResource(String)
.- Throws:
URISyntaxException
-
-