Package com.jogamp.common.util.cache
Class TempJarCache
java.lang.Object
com.jogamp.common.util.cache.TempJarCache
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidAdds all types, native libraries, class files and other files (resources) if not yet added.static final voidaddClasses(Class<?> certClass, Uri jarUri) Adds native classes, if not yet added.static final booleanaddNativeLibs(Class<?> certClass, Uri jarUri, String nativeLibraryPath) Adds native libraries, if not yet added.static final voidaddResources(Class<?> certClass, Uri jarUri) Adds native resources, if not yet added.static final 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 final StringfindLibrary(String libName) static final StringfindResource(String name) Similar toClassLoader.getResource(String).static final URIgetResource(String name) Deprecated.static final UrigetResourceUri(String name) Similar toClassLoader.getResource(String).static TempFileCachestatic booleanDocumented way to kick off static initialization.static boolean
-
Constructor Details
-
TempJarCache
public TempJarCache()
-
-
Method Details
-
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
-
checkNativeLibs
- Throws:
IOException
-
checkClasses
- Throws:
IOException
-
checkResources
- 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
-
findLibrary
-
findResource
Similar toClassLoader.getResource(String). -
getResource
Deprecated.- Throws:
URISyntaxException
-
getResourceUri
Similar toClassLoader.getResource(String).- Throws:
URISyntaxException
-
addResources(Class, Uri)