|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.net.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 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 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.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".
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
public 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)
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.