public class JarUtil
extends java.lang.Object
Constructor and Description |
---|
JarUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containsClass(java.io.File file,
java.lang.String className)
Returns true if the given .jar file exists and contains the given class.
|
static boolean |
containsClass(java.lang.String jarPath,
java.lang.String className)
Returns true if the given .jar file exists and contains the given class.
|
static boolean |
containsEntry(java.io.File file,
java.lang.String entryPath)
Returns true if the given .jar file exists and contains the entry.
|
static java.lang.String |
getJarAttribute(java.io.File file,
java.util.jar.Attributes.Name attribute)
Returns attribute value from a manifest main section,
or null if missing or a file does not contain a manifest.
|
static java.lang.String |
getJarAttribute(java.io.File file,
java.lang.String entryName,
java.util.jar.Attributes.Name attribute)
Returns attribute value from a given manifest section,
or null if missing or a file does not contain a manifest.
|
static java.util.Properties |
loadProperties(java.io.File file,
java.lang.String entryName)
Loads archive entry as Java properties.
|
public static boolean containsClass(java.lang.String jarPath, java.lang.String className)
public static boolean containsClass(java.io.File file, java.lang.String className)
public static boolean containsEntry(java.io.File file, java.lang.String entryPath)
public static java.lang.String getJarAttribute(java.io.File file, java.util.jar.Attributes.Name attribute)
public static java.lang.String getJarAttribute(java.io.File file, java.lang.String entryName, java.util.jar.Attributes.Name attribute)
public static java.util.Properties loadProperties(java.io.File file, java.lang.String entryName)