Interface Archive

All Superinterfaces:
AutoCloseable, Iterable<Archive.Entry>
All Known Implementing Classes:
ExplodedArchive, JarFileArchive

public interface Archive extends Iterable<Archive.Entry>, AutoCloseable
An archive that can be launched by the Launcher.
Since:
1.0.0
Author:
Phillip Webb
See Also:
  • Method Details

    • getUrl

      URL getUrl() throws MalformedURLException
      Returns a URL that can be used to load the archive.
      Returns:
      the archive URL
      Throws:
      MalformedURLException - if the URL is malformed
    • getManifest

      Manifest getManifest() throws IOException
      Returns the manifest of the archive.
      Returns:
      the manifest
      Throws:
      IOException - if the manifest cannot be read
    • getNestedArchives

      Iterator<Archive> getNestedArchives(Archive.EntryFilter searchFilter, Archive.EntryFilter includeFilter) throws IOException
      Returns nested Archives for entries that match the specified filters.
      Parameters:
      searchFilter - filter used to limit when additional sub-entry searching is required or null if all entries should be considered.
      includeFilter - filter used to determine which entries should be included in the result or null if all entries should be included
      Returns:
      the nested archives
      Throws:
      IOException - on IO error
      Since:
      2.3.0
    • isExploded

      default boolean isExploded()
      Return if the archive is exploded (already unpacked).
      Returns:
      if the archive is exploded
      Since:
      2.3.0
    • close

      default void close() throws Exception
      Closes the Archive, releasing any open resources.
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception - if an error occurs during close processing
      Since:
      2.2.0