|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.net.JarUtil
public final class JarUtil
Method Summary | |
---|---|
static java.lang.String |
getClassPath(java.io.File jarFile) Returns the value of the Class-Path attribute in the manifest file of the specified JAR file. |
static java.lang.String |
getClassPath(java.net.URL jarURL) Returns the value of the Class-Path attribute in the manifest file of the specified JAR URL. |
static java.lang.String |
getJarEntry(java.net.URL jarURL) Returns the jar entry name within the specified jar URL . |
static java.net.URL |
getJarFileURL(java.net.URL jarURL) Returns the jar file part of the specified jar URL . |
static JarIndex |
getJarIndex(java.net.URL jarURL) Returns the JarIndex object that represents an index of the contents of the specified jar file. |
static JarIndex |
getJarIndex(java.net.URL jarURL, boolean full) Deprecated. use #getJarIndex(URL) |
static java.lang.String |
getMainClass(java.io.File jarFile) Returns the value of the Main-Class attribute in the manifest file of the specified JAR file. |
static java.lang.String |
getMainClass(java.net.URL jarURL) Returns the value of the Main-Class attribute in the manifest file of the specified JAR URL. |
static java.util.jar.Manifest |
getManifest(java.io.File jarFile) Returns the manifest of the specified JAR file. |
static java.util.jar.Manifest |
getManifest(java.net.URL jarURL) Returns the manifest of the specified JAR URL. |
static boolean |
isArchive(java.lang.String pathname) Determine if a given URL represents an jar or zip file. |
static boolean |
isJarURL(java.net.URL jarURL) Returns true if the specified URL has the "jar" protocol. |
static void |
releaseJarIndex(java.net.URL jarURL) Releases the in-memory jar index corresponding to the specified URL . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getJarEntry(java.net.URL jarURL)
URL
. If the jar URL
specifies no entry, then the empty string is returned. If the URL
is not a jar URL
, then null
is returned.public static java.net.URL getJarFileURL(java.net.URL jarURL)
URL
. The specified URL
is returned if it is not a jar URL
.public static java.util.jar.Manifest getManifest(java.net.URL jarURL) throws java.io.IOException
java.io.IOException
public static java.util.jar.Manifest getManifest(java.io.File jarFile) throws java.io.IOException
java.io.IOException
public static java.lang.String getMainClass(java.io.File jarFile) throws java.io.IOException
Main-Class
attribute in the manifest file of the specified JAR file.java.io.IOException
public static java.lang.String getMainClass(java.net.URL jarURL) throws java.io.IOException
Main-Class
attribute in the manifest file of the specified JAR URL.java.io.IOException
public static java.lang.String getClassPath(java.io.File jarFile) throws java.io.IOException
Class-Path
attribute in the manifest file of the specified JAR file.java.io.IOException
public static java.lang.String getClassPath(java.net.URL jarURL) throws java.io.IOException
Class-Path
attribute in the manifest file of the specified JAR URL.java.io.IOException
public static boolean isJarURL(java.net.URL jarURL)
true
if the specified URL
has the "jar" protocol. Returns false
if the specified URL
is null
or has a protocol other than "jar". Alas, Websphere uses "wsjar" as an alias for "jar" protocol.public static JarIndex getJarIndex(java.net.URL jarURL) throws java.io.IOException
JarIndex
object that represents an index of the contents of the specified jar file. If the jar file does not exist or if the URL
points to content that is not a a jar file, then null
is returned.
This method caches its results, so that if an index is requested for the same URL
more than once, the previously calculated JarIndex
is returned. However, as an implementation detail, this method may use an algorithm for removing cached indexes that have not been accessed recently in order to conserve memory. The details of that algorithm, if one is implemented, are not publically documented. If a previously cached index is removed and is subsequently requested later, it is simply rebuilt.
jarURL
- This is the URL
of the jar file. If this URL
has the "jar" protocol, then the jar file part of the jar URL
is extracted and indexed. Otherwise, the URL
is assumed to point to a jar/zip file, and that file is indexed.java.io.IOException
@Deprecated
public static JarIndex getJarIndex(java.net.URL jarURL,
boolean full)
throws java.io.IOException
full
parameter indicates whether a full index is built initially. A full index takes much longer to create. If the caller just needs to check for the existance of entries in the JAR, or open input streams for entries, then a full index is not necessary. A full index is necessary for other operations, such as listing all entries in the JAR or within a directory in the JAR.jarURL
- the URL of the JAR filefull
- whether to build a full indexjava.io.IOException
- if the JAR file could not be readpublic static void releaseJarIndex(java.net.URL jarURL)
URL
. The URL
may point to the jar file itself or it may be a jar URL pointing to an entry within a jar. If the URL is null
, this method has no effect.public static boolean isArchive(java.lang.String pathname)
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |