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 Manifest
getManifest()
Returns the manifest of the archive.protected Archive
getNestedArchive(Archive.Entry entry)
List<Archive>
getNestedArchives(Archive.EntryFilter filter)
Returns nestedArchive
s for entries that match the specified filter.URL
getUrl()
Returns a URL that can be used to load the archive.Iterator<Archive.Entry>
iterator()
String
toString()
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:Archive
Returns a URL that can be used to load the archive.- Specified by:
getUrl
in interfaceArchive
- Returns:
- the archive URL
- Throws:
MalformedURLException
- if the URL is malformed
getManifest
public Manifest getManifest() throws IOException
Description copied from interface:Archive
Returns the manifest of the archive.- Specified by:
getManifest
in 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:Archive
Returns nestedArchive
s for entries that match the specified filter.- Specified by:
getNestedArchives
in 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:
iterator
in interfaceIterable<Archive.Entry>
getNestedArchive
protected Archive getNestedArchive(Archive.Entry entry) throws IOException
- Throws:
IOException