Class ExplodedArchive
- java.lang.Object
- org.springframework.boot.loader.archive.ExplodedArchive
- All Implemented Interfaces:
Iterable<Archive.Entry>,Archive
public class ExplodedArchive extends Object implements Archive
Archiveimplementation backed by an exploded archive directory.
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.boot.loader.archive.Archive
Archive.Entry, Archive.EntryFilter
Constructor Summary
Constructors Constructor Description ExplodedArchive(File root)Create a newExplodedArchiveinstance.ExplodedArchive(File root, boolean recursive)Create a newExplodedArchiveinstance.
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
ExplodedArchive
public ExplodedArchive(File root)
Create a newExplodedArchiveinstance.- Parameters:
root- the root folder
ExplodedArchive
public ExplodedArchive(File root, boolean recursive)
Create a newExplodedArchiveinstance.- Parameters:
root- the root folderrecursive- if recursive searching should be used to locate the manifest. Defaults totrue, folders with a large tree might want to set this tofalse.
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