Class JarFileArchive
- java.lang.Object
- org.springframework.boot.loader.archive.JarFileArchive
- All Implemented Interfaces:
Iterable<Archive.Entry>,Archive
public class JarFileArchive extends Object implements Archive
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.boot.loader.archive.Archive
Archive.Entry, Archive.EntryFilter
Constructor Summary
Constructors Constructor Description JarFileArchive(File file)JarFileArchive(File file, URL url)JarFileArchive(JarFile jarFile)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ManifestgetManifest()Returns the manifest of the archive.protected ArchivegetNestedArchive(Archive.Entry entry)List<Archive>getNestedArchives(Archive.EntryFilter filter)Returns nestedArchives for entries that match the specified filter.URLgetUrl()Returns a URL that can be used to load the archive.Iterator<Archive.Entry>iterator()StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Constructor Detail
JarFileArchive
public JarFileArchive(File file) throws IOException
- Throws:
IOException
JarFileArchive
public JarFileArchive(File file, URL url) throws IOException
- Throws:
IOException
JarFileArchive
public JarFileArchive(JarFile jarFile)
Method Detail
getUrl
public URL getUrl() throws MalformedURLException
Description copied from interface:ArchiveReturns a URL that can be used to load the archive.- Specified by:
getUrlin interfaceArchive- Returns:
- the archive URL
- Throws:
MalformedURLException- if the URL is malformed
getManifest
public Manifest getManifest() throws IOException
Description copied from interface:ArchiveReturns the manifest of the archive.- Specified by:
getManifestin interfaceArchive- Returns:
- the manifest
- Throws:
IOException- if the manifest cannot be read
getNestedArchives
public List<Archive> getNestedArchives(Archive.EntryFilter filter) throws IOException
Description copied from interface:ArchiveReturns nestedArchives for entries that match the specified filter.- Specified by:
getNestedArchivesin interfaceArchive- Parameters:
filter- the filter used to limit entries- Returns:
- nested archives
- Throws:
IOException- if nested archives cannot be read
iterator
public Iterator<Archive.Entry> iterator()
- Specified by:
iteratorin interfaceIterable<Archive.Entry>
getNestedArchive
protected Archive getNestedArchive(Archive.Entry entry) throws IOException
- Throws:
IOException