public abstract class AbstractInputStreamJar extends Object implements Jar
| Constructor and Description |
|---|
AbstractInputStreamJar(URL jarFileUrl) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeStream() |
protected abstract NonClosingJarInputStream |
createJarInputStream() |
boolean |
entryExists(String name)
Deprecated.
|
boolean |
exists(String name)
Determine if the given resource in present in the JAR.
|
InputStream |
getEntryInputStream()
Obtains the input stream for the current entry.
|
String |
getEntryName()
Obtains the name of the current entry.
|
InputStream |
getInputStream(String name)
Obtain an
InputStream for a given entry in a JAR. |
URL |
getJarFileURL() |
long |
getLastModified(String name)
Obtain the last modified time for the given resource in the JAR.
|
Manifest |
getManifest()
Obtain the manifest for the JAR file.
|
String |
getURL(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 AbstractInputStreamJar(URL jarFileUrl)
public URL getJarFileURL()
getJarFileURL in interface Jarpublic void nextEntry()
Jarpublic String getEntryName()
JargetEntryName in interface Jarpublic InputStream getEntryInputStream() throws IOException
JargetEntryInputStream in interface JarIOException - If the stream cannot be obtained@Deprecated public boolean entryExists(String name) throws IOException
JarentryExists in interface Jarname - Entry to look forfalseIOException - if an I/O error occurs while processing the JAR file
entriespublic InputStream getInputStream(String name) throws IOException
JarInputStream for a given entry in a JAR. The caller is
responsible for closing the stream.getInputStream in interface Jarname - Entry to obtain an InputStream forInputStream for the specified entry or null if
the entry does not existIOException - if an I/O error occurs while processing the JAR filepublic long getLastModified(String name) throws IOException
JargetLastModified in interface Jarname - Entry to obtain the modification time forSystem.currentTimeMillis() that the resource was last
modified. Returns -1 if the entry does not existIOException - if an I/O error occurs while processing the JAR filepublic boolean exists(String name) throws IOException
Jarexists in interface Jarname - Entry to look fortrue if the entry is present in the JAR, otherwise
falseIOException - if an I/O error occurs while processing the JAR filepublic String getURL(String entry)
JarJarFactory to ensure resources are
accessed correctly.public Manifest getManifest() throws IOException
JargetManifest in interface JarIOException - If an I/O error occurs trying to obtain the manifestpublic void reset()
throws IOException
Jarreset in interface JarIOException - If the pointer cannot be resetprotected void closeStream()
protected abstract NonClosingJarInputStream createJarInputStream() throws IOException
IOExceptionCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.