Interface Archive
- All Superinterfaces:
AutoCloseable
An archive that can be launched by the
Launcher
.- Since:
- 3.2.0
- Author:
- Phillip Webb
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a single entry in the archive. -
Field Summary
Modifier and TypeFieldDescriptionstatic final Predicate<Archive.Entry>
Predicate that accepts all entries. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
Closes theArchive
, releasing any open resources.static Archive
static Archive
static Archive
create
(ProtectionDomain protectionDomain) getClassPathUrls
(Predicate<Archive.Entry> includeFilter) Returns classpath URLs for the archive that match the specified filter.getClassPathUrls
(Predicate<Archive.Entry> includeFilter, Predicate<Archive.Entry> directorySearchFilter) Returns classpath URLs for the archive that match the specified filters.Returns the manifest of the archive.default File
Returns the root directory of this archive ornull
if the archive is not backed by a directory.default boolean
Returns if this archive is backed by an exploded archive directory.
-
Field Details
-
ALL_ENTRIES
Predicate that accepts all entries.
-
-
Method Details
-
getManifest
Returns the manifest of the archive.- Returns:
- the manifest or
null
- Throws:
IOException
- if the manifest cannot be read
-
getClassPathUrls
Returns classpath URLs for the archive that match the specified filter.- Parameters:
includeFilter
- filter used to determine which entries should be included.- Returns:
- the classpath URLs
- Throws:
IOException
- on IO error
-
getClassPathUrls
Set<URL> getClassPathUrls(Predicate<Archive.Entry> includeFilter, Predicate<Archive.Entry> directorySearchFilter) throws IOException Returns classpath URLs for the archive that match the specified filters.- Parameters:
includeFilter
- filter used to determine which entries should be includeddirectorySearchFilter
- filter used to optimize tree walking for exploded archives by determining if a directory needs to be searched or not- Returns:
- the classpath URLs
- Throws:
IOException
- on IO error
-
isExploded
default boolean isExploded()Returns if this archive is backed by an exploded archive directory.- Returns:
- if the archive is exploded
-
getRootDirectory
Returns the root directory of this archive ornull
if the archive is not backed by a directory.- Returns:
- the root directory
-
close
Closes theArchive
, releasing any open resources.- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
- if an error occurs during close processing
-
create
-
create
- Throws:
Exception
-
create
-