Interface Archive
- All Superinterfaces:
AutoCloseable
An archive that can be launched by the
Launcher.- Since:
- 3.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a single entry in the archive. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Predicate<Archive.Entry> Predicate that accepts all entries. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Closes theArchive, releasing any open resources.static Archivestatic Archivestatic Archivecreate(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 FileReturns the root directory of this archive ornullif the archive is not backed by a directory.default booleanReturns 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 ornullif the archive is not backed by a directory.- Returns:
- the root directory
-
close
Closes theArchive, releasing any open resources.- Specified by:
closein interfaceAutoCloseable- Throws:
Exception- if an error occurs during close processing
-
create
-
create
- Throws:
Exception
-
create
-