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
Archive
implementation 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 newExplodedArchive
instance.ExplodedArchive(File root, boolean recursive)
Create a newExplodedArchive
instance.
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
ExplodedArchive
public ExplodedArchive(File root)
Create a newExplodedArchive
instance.- Parameters:
root
- the root folder
ExplodedArchive
public ExplodedArchive(File root, boolean recursive)
Create a newExplodedArchive
instance.- 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: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