public class JarFileArchive extends Object implements Archive
Archive.Entry, Archive.EntryFilter
Constructor and Description |
---|
JarFileArchive(File file) |
JarFileArchive(File file,
URL url) |
JarFileArchive(JarFile jarFile) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
Archive , releasing any open resources. |
Manifest |
getManifest()
Returns the manifest of the archive.
|
protected Archive |
getNestedArchive(Archive.Entry entry) |
Iterator<Archive> |
getNestedArchives(Archive.EntryFilter searchFilter,
Archive.EntryFilter includeFilter)
Returns nested
Archive s for entries that match the specified filters. |
URL |
getUrl()
Returns a URL that can be used to load the archive.
|
Iterator<Archive.Entry> |
iterator()
Return a new iterator for the archive entries.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNestedArchives, isExploded
forEach, spliterator
public JarFileArchive(File file) throws IOException
IOException
public JarFileArchive(File file, URL url) throws IOException
IOException
public JarFileArchive(JarFile jarFile)
public URL getUrl() throws MalformedURLException
Archive
getUrl
in interface Archive
MalformedURLException
- if the URL is malformedpublic Manifest getManifest() throws IOException
Archive
getManifest
in interface Archive
IOException
- if the manifest cannot be readpublic Iterator<Archive> getNestedArchives(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) throws IOException
Archive
Archive
s for entries that match the specified filters.getNestedArchives
in interface Archive
searchFilter
- filter used to limit when additional sub-entry searching is
required or null
if all entries should be considered.includeFilter
- filter used to determine which entries should be included in
the result or null
if all entries should be includedIOException
- on IO errorpublic Iterator<Archive.Entry> iterator()
Archive
iterator
in interface Iterable<Archive.Entry>
iterator
in interface Archive
Iterable.iterator()
public void close() throws IOException
Archive
Archive
, releasing any open resources.close
in interface AutoCloseable
close
in interface Archive
IOException
protected Archive getNestedArchive(Archive.Entry entry) throws IOException
IOException