|
static void | setResolver (final Resolver r) throws IllegalArgumentException, IllegalStateException, SecurityException |
| Setting a custom Resolver instance. More...
|
|
static boolean | hasJarUri (final String clazzBinName, final ClassLoader cl) |
| Returns true if the Class's "com.jogamp.common.GlueGenVersion" is loaded from a JarFile and hence has a Jar URI like URI jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class" . More...
|
|
static Uri | getJarUri (final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException |
| The Class's "com.jogamp.common.GlueGenVersion" Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class" will be returned. More...
|
|
static Uri.Encoded | getJarBasename (final Uri classJarUri) throws IllegalArgumentException |
| The Class's Jar Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class Jar basename gluegen-rt.jar will be returned. More...
|
|
static Uri.Encoded | getJarBasename (final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException |
| The Class's com.jogamp.common.GlueGenVersion Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class Jar basename gluegen-rt.jar will be returned. More...
|
|
static Uri.Encoded | getJarEntry (final Uri classJarUri) |
| The Class's Jar Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class Jar file's entry /com/jogamp/common/GlueGenVersion.class will be returned. More...
|
|
static Uri | getJarFileUri (final String clazzBinName, final ClassLoader cl) throws IllegalArgumentException, IOException, URISyntaxException |
| The Class's "com.jogamp.common.GlueGenVersion" Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/com/jogamp/common/GlueGenVersion.class" Jar file Uri jar:sub_protocol:/some/path/gluegen-rt.jar!/ will be returned. More...
|
|
static Uri | getJarFileUri (final Uri baseUri, final Uri.Encoded jarFileName) throws IllegalArgumentException, URISyntaxException |
|
static Uri | getJarFileUri (final Uri jarSubUri) throws IllegalArgumentException, URISyntaxException |
|
static Uri | getJarFileUri (final Uri.Encoded jarSubUriS) throws IllegalArgumentException, URISyntaxException |
|
static Uri | getJarEntryUri (final Uri jarFileUri, final Uri.Encoded jarEntry) throws IllegalArgumentException, URISyntaxException |
|
static JarFile | getJarFile (final String clazzBinName, final ClassLoader cl) throws IOException, IllegalArgumentException, URISyntaxException |
|
static JarFile | getJarFile (final Uri jarFileUri) throws IOException, IllegalArgumentException, URISyntaxException |
|
static Uri | getRelativeOf (final Class<?> classFromJavaJar, final Uri.Encoded cutOffInclSubDir, final Uri.Encoded relResPath) throws IllegalArgumentException, IOException, URISyntaxException |
| Locates the Jar file Uri of a given resource relative to a given class's Jar's Uri. More...
|
|
static Map< String, String > | getNativeLibNames (final JarFile jarFile) |
| Return a map from native-lib-base-name to entry-name. More...
|
|
static final int | extract (final File dest, final Map< String, String > nativeLibMap, final JarFile jarFile, final String nativeLibraryPath, final boolean extractNativeLibraries, final boolean extractClassFiles, final boolean extractOtherFiles) throws IOException |
| Extract the files of the given jar file. More...
|
|
static final void | validateCertificates (final Certificate[] rootCerts, final JarFile jarFile) throws IOException, SecurityException |
| Validate the certificates for each native Lib in the jar file. More...
|
|
Definition at line 54 of file JarUtil.java.
static final int org.jau.pkg.JarUtil.extract |
( |
final File |
dest, |
|
|
final Map< String, String > |
nativeLibMap, |
|
|
final JarFile |
jarFile, |
|
|
final String |
nativeLibraryPath, |
|
|
final boolean |
extractNativeLibraries, |
|
|
final boolean |
extractClassFiles, |
|
|
final boolean |
extractOtherFiles |
|
) |
| throws IOException |
|
static |
Extract the files of the given jar file.
If extractNativeLibraries
is true, native libraries are added to the given nativeLibMap
with the base name to temp file location.
A file is identified as a native library, if it's name complies with the running platform's native library naming scheme.
Root entries are favored over non root entries in case of naming collisions.
Example on a Unix like machine:
mylib.jar!/sub1/libsour.so -> sour (mapped, unique name)
mylib.jar!/sub1/libsweet.so (dropped, root entry favored)
mylib.jar!/libsweet.so -> sweet (mapped, root entry favored)
mylib.jar!/sweet.dll -> (dropped, not a unix library name)
In order to be compatible with Java Web Start, we need to extract all root entries from the jar file.
In this case, set all flags to true extractNativeLibraries
. extractClassFiles
, extractOtherFiles
.
- Parameters
-
dest | |
nativeLibMap | |
jarFile | |
nativeLibraryPath | if not null, only extracts native libraries within this path. |
extractNativeLibraries | |
extractClassFiles | |
extractOtherFiles | |
deepDirectoryTraversal | |
- Returns
- Exceptions
-
Definition at line 541 of file JarUtil.java.
static Uri org.jau.pkg.JarUtil.getRelativeOf |
( |
final Class<?> |
classFromJavaJar, |
|
|
final Uri.Encoded |
cutOffInclSubDir, |
|
|
final Uri.Encoded |
relResPath |
|
) |
| throws IllegalArgumentException, IOException, URISyntaxException |
|
static |
Locates the Jar file Uri
of a given resource relative to a given class's Jar's Uri.
class's jar url path + cutOffInclSubDir + relResPath,
Example #1
classFromJavaJar = com.lighting.Test (in: file:/storage/TestLighting.jar)
cutOffInclSubDir = lights/
relResPath = LightAssets.jar
Result : file:/storage/lights/LightAssets.jar
Example #2
classFromJavaJar = com.lighting.Test (in: file:/storage/lights/TestLighting.jar)
cutOffInclSubDir = lights/
relResPath = LightAssets.jar
Result : file:/storage/lights/LightAssets.jar
TODO: Enhance documentation!
- Parameters
-
classFromJavaJar | Used to get the root Uri for the class's Jar Uri. |
cutOffInclSubDir | The cut off included sub-directory prepending the relative resource path. If the root Uri includes cutOffInclSubDir, it is no more added to the result. |
relResPath | The relative resource path. (Uri encoded) |
- Returns
- The resulting resource Uri, which is not tested.
- Exceptions
-
IllegalArgumentException | |
IOException | |
URISyntaxException | |
Definition at line 448 of file JarUtil.java.