Class ExplodedArchive
java.lang.Object
org.springframework.boot.loader.archive.ExplodedArchive
- All Implemented Interfaces:
AutoCloseable,Iterable<Archive.Entry>,Archive
Archive implementation backed by an exploded archive directory.- Since:
- 1.0.0
- Author:
- Phillip Webb, Andy Wilkinson, Madhura Bhave
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.boot.loader.archive.Archive
Archive.Entry, Archive.EntryFilter -
Constructor Summary
ConstructorsConstructorDescriptionExplodedArchive(File root) Create a newExplodedArchiveinstance.ExplodedArchive(File root, boolean recursive) Create a newExplodedArchiveinstance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the manifest of the archive.protected ArchivegetNestedArchive(Archive.Entry entry) getNestedArchives(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) Returns nestedArchives for entries that match the specified filters.getUrl()Returns a URL that can be used to load the archive.booleanReturn if the archive is exploded (already unpacked).iterator()Deprecated.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ExplodedArchive
Create a newExplodedArchiveinstance.- Parameters:
root- the root directory
-
ExplodedArchive
Create a newExplodedArchiveinstance.- Parameters:
root- the root directoryrecursive- if recursive searching should be used to locate the manifest. Defaults totrue, directories with a large tree might want to set this tofalse.
-
-
Method Details
-
getUrl
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
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 Iterator<Archive> getNestedArchives(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) throws IOException Description copied from interface:ArchiveReturns nestedArchives for entries that match the specified filters.- Specified by:
getNestedArchivesin interfaceArchive- Parameters:
searchFilter- filter used to limit when additional sub-entry searching is required ornullif all entries should be considered.includeFilter- filter used to determine which entries should be included in the result ornullif all entries should be included- Returns:
- the nested archives
- Throws:
IOException- on IO error
-
iterator
Deprecated.- Specified by:
iteratorin interfaceIterable<Archive.Entry>
-
getNestedArchive
- Throws:
IOException
-
isExploded
public boolean isExploded()Description copied from interface:ArchiveReturn if the archive is exploded (already unpacked).- Specified by:
isExplodedin interfaceArchive- Returns:
- if the archive is exploded
-
toString
-