Constructor and Description |
---|
JarFileUrlJar(java.net.URL url,
boolean startsWithJar) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close any resources associated with this JAR.
|
boolean |
entryExists(java.lang.String name)
Deprecated.
|
java.io.InputStream |
getEntryInputStream()
Obtains the input stream for the current entry.
|
java.lang.String |
getEntryName()
Obtains the name of the current entry.
|
java.io.InputStream |
getInputStream(java.lang.String name)
Obtain an
InputStream for a given entry in a JAR. |
java.net.URL |
getJarFileURL() |
long |
getLastModified(java.lang.String name)
Obtain the last modified time for the given resource in the JAR.
|
java.util.jar.Manifest |
getManifest()
Obtain the manifest for the JAR file.
|
java.lang.String |
getURL(java.lang.String entry)
Obtain, in String form, the URL for an entry in this JAR.
|
void |
nextEntry()
Moves the internal pointer to the next entry in the JAR.
|
void |
reset()
Resets the internal pointer used to track JAR entries to the beginning of
the JAR.
|
public JarFileUrlJar(java.net.URL url, boolean startsWithJar) throws java.io.IOException
java.io.IOException
public java.net.URL getJarFileURL()
getJarFileURL
in interface Jar
@Deprecated public boolean entryExists(java.lang.String name)
Jar
entryExists
in interface Jar
name
- Entry to look forfalse
public java.io.InputStream getInputStream(java.lang.String name) throws java.io.IOException
Jar
InputStream
for a given entry in a JAR. The caller is
responsible for closing the stream.getInputStream
in interface Jar
name
- Entry to obtain an InputStream
forInputStream
for the specified entry or null if
the entry does not existjava.io.IOException
- if an I/O error occurs while processing the JAR filepublic long getLastModified(java.lang.String name) throws java.io.IOException
Jar
getLastModified
in interface Jar
name
- Entry to obtain the modification time forSystem.currentTimeMillis()
that the resource was last
modified. Returns -1 if the entry does not existjava.io.IOException
- if an I/O error occurs while processing the JAR filepublic java.lang.String getURL(java.lang.String entry)
Jar
JarFactory
to ensure resources are
accessed correctly.public void close()
Jar
public void nextEntry()
Jar
public java.lang.String getEntryName()
Jar
getEntryName
in interface Jar
public java.io.InputStream getEntryInputStream() throws java.io.IOException
Jar
getEntryInputStream
in interface Jar
java.io.IOException
- If the stream cannot be obtainedpublic java.util.jar.Manifest getManifest() throws java.io.IOException
Jar
getManifest
in interface Jar
java.io.IOException
- If an I/O error occurs trying to obtain the manifestCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.