public final class JarUtil extends Object
Modifier and Type | Method and Description |
---|---|
static URL[] |
getClassPath(URL jarURL)
Returns the URLs of the JARs listed in the
Class-Path
attribute of the manifest of a JAR. |
static String |
getClassPathAttribute(URL jarURL)
Returns the
Class-Path attribute of the manifest
of a JAR. |
static Map<String,String[]> |
getServiceProviders(URL jarURL)
Returns the service providers found in a JAR.
|
public static URL[] getClassPath(URL jarURL) throws IOException
Class-Path
attribute of the manifest of a JAR.jarURL
- the URL of the JARClass-Path
attribute of the manifest or an empty array if the manifest or the
Class-Path
attribute were not foundIOException
- if an I/O error occurs while reading the JARpublic static String getClassPathAttribute(URL jarURL) throws IOException
Class-Path
attribute of the manifest
of a JAR.jarURL
- the URL of the JARClass-Path
attribute of the manifest if any;
null
otherwiseIOException
- if an I/O error occurs while reading the JARpublic static Map<String,String[]> getServiceProviders(URL jarURL) throws IOException
jarURL
- the URL of the JARIOException
- if an I/O error occurs while reading the JAR