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
ConstructorDescriptionExplodedArchive
(File root) Create a newExplodedArchive
instance.ExplodedArchive
(File root, boolean recursive) Create a newExplodedArchive
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the manifest of the archive.protected Archive
getNestedArchive
(Archive.Entry entry) getNestedArchives
(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) Returns nestedArchive
s for entries that match the specified filters.getUrl()
Returns a URL that can be used to load the archive.boolean
Return 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, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ExplodedArchive
Create a newExplodedArchive
instance.- Parameters:
root
- the root directory
-
ExplodedArchive
Create a newExplodedArchive
instance.- 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: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
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 Iterator<Archive> getNestedArchives(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) throws IOException Description copied from interface:Archive
Returns nestedArchive
s for entries that match the specified filters.- Specified by:
getNestedArchives
in interfaceArchive
- Parameters:
searchFilter
- filter used to limit when additional sub-entry searching is required ornull
if all entries should be considered.includeFilter
- filter used to determine which entries should be included in the result ornull
if all entries should be included- Returns:
- the nested archives
- Throws:
IOException
- on IO error
-
iterator
Deprecated.- Specified by:
iterator
in interfaceIterable<Archive.Entry>
-
getNestedArchive
-
isExploded
public boolean isExploded()Description copied from interface:Archive
Return if the archive is exploded (already unpacked).- Specified by:
isExploded
in interfaceArchive
- Returns:
- if the archive is exploded
-
toString
-