接口 Archive

所有超级接口:
AutoCloseable

public interface Archive extends AutoCloseable
An archive that can be launched by the Launcher.
从以下版本开始:
3.2.0
作者:
Phillip Webb
  • 字段详细资料

  • 方法详细资料

    • getManifest

      Manifest getManifest() throws IOException
      Returns the manifest of the archive.
      返回:
      the manifest or null
      抛出:
      IOException - if the manifest cannot be read
    • getClassPathUrls

      default Set<URL> getClassPathUrls(Predicate<Archive.Entry> includeFilter) throws IOException
      Returns classpath URLs for the archive that match the specified filter.
      参数:
      includeFilter - filter used to determine which entries should be included.
      返回:
      the classpath URLs
      抛出:
      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.
      参数:
      includeFilter - filter used to determine which entries should be included
      directorySearchFilter - filter used to optimize tree walking for exploded archives by determining if a directory needs to be searched or not
      返回:
      the classpath URLs
      抛出:
      IOException - on IO error
    • isExploded

      default boolean isExploded()
      Returns if this archive is backed by an exploded archive directory.
      返回:
      if the archive is exploded
    • getRootDirectory

      default File getRootDirectory()
      Returns the root directory of this archive or null if the archive is not backed by a directory.
      返回:
      the root directory
    • close

      default void close() throws Exception
      Closes the Archive, releasing any open resources.
      指定者:
      close 在接口中 AutoCloseable
      抛出:
      Exception - if an error occurs during close processing
    • create

      static Archive create(Class<?> target) throws Exception
      Factory method to create an appropriate Archive from the given Class target.
      参数:
      target - a target class that will be used to find the archive code source
      返回:
      an new Archive instance
      抛出:
      Exception - if the archive cannot be created
    • create

      static Archive create(ProtectionDomain protectionDomain) throws Exception
      抛出:
      Exception
    • create

      static Archive create(File target) throws Exception
      Factory method to create an Archive from the given File target.
      参数:
      target - a target File used to create the archive. May be a directory or a jar file.
      返回:
      a new Archive instance.
      抛出:
      Exception - if the archive cannot be created