java.util.jar.JarFile and java.util.jar.JarInputStream ) have
significantly different performance characteristics depending on the form of
the URL used to access the JAR. For file based JAR java.net.URL s,
java.util.jar.JarFile is faster but for non-file based
java.net.URL s, java.util.jar.JarFile creates a copy of the
JAR in the temporary directory so java.util.jar.JarInputStream is
faster.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | |
| public InputStream | |
| public String | |
| public InputStream | Returns: AnInputStream for the specified entry or null if
the entry does not existEntry to obtain an name)InputStream forObtain an |
| public URL | |
| public long | Returns: The time (in the same format asSystem#currentTimeMillis() that the resource was last
modified. Returns -1 if the entry does not existEntry to obtain the modification time for name)Obtain the last modified time for the given resource in the JAR. |
| public Manifest | |
| public String | |
| public void | |
| public void |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Close any resources associated with this JAR.
| |
| exists | back to summary |
|---|---|
| public boolean exists(String name) throws IOException Determine if the given resource in present in the JAR.
| |
| getEntryInputStream | back to summary |
|---|---|
| public InputStream getEntryInputStream() throws IOException Obtains the input stream for the current entry.
| |
| getEntryName | back to summary |
|---|---|
| public String getEntryName() Obtains the name of the current entry.
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream(String name) throws IOException Obtain an
| |
| getJarFileURL | back to summary |
|---|---|
public URL getJarFileURL()
| |
| getLastModified | back to summary |
|---|---|
| public long getLastModified(String name) throws IOException Obtain the last modified time for the given resource in the JAR.
| |
| getManifest | back to summary |
|---|---|
| public Manifest getManifest() throws IOException Obtain the manifest for the JAR file.
| |
| getURL | back to summary |
|---|---|
| public String getURL(String entry) Obtain, in String form, the URL for an entry in this JAR. Note that for
JARs nested in WAR files, the Tomcat specific war:file:... form will not
be used, rather the jar:jar:file:... form (that the JRE does not
understand will be used). Note that this means that any code using these
URLs will need to understand the jar:jar:file:... form and use the
| |
| nextEntry | back to summary |
|---|---|
| public void nextEntry() Moves the internal pointer to the next entry in the JAR. | |
| reset | back to summary |
|---|---|
| public void reset() throws IOException Resets the internal pointer used to track JAR entries to the beginning of the JAR.
| |