Class JarFileArchive
java.lang.Object
org.springframework.boot.loader.archive.JarFileArchive
- All Implemented Interfaces:
AutoCloseable
,Iterable<Archive.Entry>
,Archive
- Since:
- 1.0.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.boot.loader.archive.Archive
Archive.Entry, Archive.EntryFilter
-
Constructor Summary
ConstructorDescriptionJarFileArchive
(File file) JarFileArchive
(File file, URL url) JarFileArchive
(JarFile jarFile) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes theArchive
, releasing any open resources.Returns 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.iterator()
Deprecated.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.boot.loader.archive.Archive
isExploded
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
JarFileArchive
- Throws:
IOException
-
JarFileArchive
- Throws:
IOException
-
JarFileArchive
-
-
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>
-
close
Description copied from interface:Archive
Closes theArchive
, releasing any open resources.- Specified by:
close
in interfaceArchive
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
getNestedArchive
- Throws:
IOException
-
toString
-