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 classTempJarCache.LoadState
-
Constructor Summary
Constructors Constructor Description TempJarCache()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddAll(Class<?> certClass, Uri jarUri)Adds all types, native libraries, class files and other files (resources) if not yet added.static voidaddClasses(Class<?> certClass, Uri jarUri)Adds native classes, if not yet added.static booleanaddNativeLibs(Class<?> certClass, Uri jarUri, String nativeLibraryPath)Adds native libraries, if not yet added.static voidaddResources(Class<?> certClass, Uri jarUri)Adds native resources, if not yet added.static voidaddResources(Class<?> certClass, URI jarURI)Deprecated.static booleancheckClasses(Uri jarUri, TempJarCache.LoadState exp)static booleancheckNativeLibs(Uri jarUri, TempJarCache.LoadState exp)static booleancheckResources(Uri jarUri, TempJarCache.LoadState exp)static StringfindLibrary(String libName)static StringfindResource(String name)Similar toClassLoader.getResource(String).static URIgetResource(String name)Deprecated.static UrigetResourceUri(String name)Similar toClassLoader.getResource(String).static TempFileCachegetTempFileCache()static booleaninitSingleton()Documented way to kick off static initialization.static booleanisInitialized()
-
-
-
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 thejarUricould not be loaded or a previous load attempt failedSecurityExceptionURISyntaxExceptionIllegalArgumentException
-
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 thejarUricould not be loaded or a previous load attempt failedSecurityExceptionURISyntaxExceptionIllegalArgumentException
-
addResources
public static final void addResources(Class<?> certClass, URI jarURI) throws IOException, SecurityException, IllegalArgumentException, URISyntaxException
Deprecated.- Parameters:
certClass-jarURI-- Throws:
IOExceptionSecurityExceptionIllegalArgumentExceptionURISyntaxException
-
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 thejarUricould not be loaded or a previous load attempt failedSecurityExceptionURISyntaxExceptionIllegalArgumentException
-
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 thejarUricould not be loaded or a previous load attempt failedSecurityExceptionURISyntaxExceptionIllegalArgumentException
-
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
-
-