Class ReadableArchiveAdapter

java.lang.Object
org.glassfish.api.deployment.archive.ReadableArchiveAdapter
All Implemented Interfaces:
AutoCloseable, Archive, ReadableArchive

public abstract class ReadableArchiveAdapter extends Object implements ReadableArchive
A lot of methods need to be written in order to implement ReadableArchive. The no-op methods are implemented here to make ScatteredWar easier to understand.
Author:
Byron Nevins
  • Constructor Details

    • ReadableArchiveAdapter

      public ReadableArchiveAdapter()
  • Method Details

    • getEntrySize

      public long getEntrySize(String arg0)
      Description copied from interface: ReadableArchive
      Returns the entry size for a given entry name or 0 if not known
      Specified by:
      getEntrySize in interface ReadableArchive
      Parameters:
      arg0 - the entry name
      Returns:
      the entry size
    • open

      public void open(URI arg0) throws IOException
      Description copied from interface: ReadableArchive
      Open an abstract archive
      Specified by:
      open in interface ReadableArchive
      Parameters:
      arg0 - path to the archive
      Throws:
      IOException
    • getSubArchive

      public ReadableArchive getSubArchive(String arg0) throws IOException
      Description copied from interface: ReadableArchive
      Returns an instance of this archive abstraction for an embedded archive within this archive.
      Specified by:
      getSubArchive in interface ReadableArchive
      Parameters:
      arg0 - is the entry name relative to the root for the archive
      Returns:
      the Archive instance for this abstraction, or null if no such entry exists.
      Throws:
      IOException
    • delete

      public boolean delete()
      Description copied from interface: ReadableArchive
      deletes the archive
      Specified by:
      delete in interface ReadableArchive
    • renameTo

      public boolean renameTo(String arg0)
      Description copied from interface: ReadableArchive
      rename the archive
      Specified by:
      renameTo in interface ReadableArchive
      Parameters:
      arg0 - the archive name
    • close

      public void close() throws IOException
      Description copied from interface: Archive
      closes this archive and releases all resources
      Specified by:
      close in interface Archive
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • getArchiveSize

      public long getArchiveSize() throws SecurityException
      Description copied from interface: Archive
      Returns the size of the archive.
      Specified by:
      getArchiveSize in interface Archive
      Returns:
      long indicating the size of the archive
      Throws:
      SecurityException
    • exists

      public boolean exists()
      Specified by:
      exists in interface ReadableArchive
      Returns:
      true if this archive exists
    • entries

      public Enumeration<String> entries()
      Description copied from interface: Archive
      Returns an enumeration of the module file entries. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.
      Specified by:
      entries in interface Archive
      Returns:
      an enumeration of the archive file entries.
    • entries

      public Enumeration<String> entries(String prefix)
      Description copied from interface: Archive
      Returns an enumeration of the module file entries with the specified prefix. All elements in the enumeration are of type String. Each String represents a file name relative to the root of the module.
      Specified by:
      entries in interface Archive
      Parameters:
      prefix - the prefix of entries to be included
      Returns:
      an enumeration of the archive file entries.
    • getDirectories

      public Collection<String> getDirectories() throws IOException
      Description copied from interface: Archive
      Returns the enumeration of first level directories in this archive
      Specified by:
      getDirectories in interface Archive
      Returns:
      enumeration of directories under the root of this archive
      Throws:
      IOException
    • isDirectory

      public boolean isDirectory(String name)
      Description copied from interface: Archive
      Returns true if the entry is a directory or a plain file
      Specified by:
      isDirectory in interface Archive
      Parameters:
      name - name is one of the entries returned by Archive.entries()
      Returns:
      true if the entry denoted by the passed name is a directory
    • setParentArchive

      public void setParentArchive(ReadableArchive parentArchive)
      Description copied from interface: ReadableArchive
      set the parent archive for this archive
      Specified by:
      setParentArchive in interface ReadableArchive
      Parameters:
      parentArchive - the parent archive
    • getParentArchive

      public ReadableArchive getParentArchive()
      Description copied from interface: ReadableArchive
      get the parent archive of this archive
      Specified by:
      getParentArchive in interface ReadableArchive
      Returns:
      the parent archive
    • getExtraData

      public <U> U getExtraData(Class<U> dataType)
      Description copied from interface: ReadableArchive
      Returns any data that could have been calculated as part of the descriptor loading.
      Specified by:
      getExtraData in interface ReadableArchive
      Parameters:
      dataType - the type of the extra data
      Returns:
      the extra data or null if there are not an instance of type dataType registered.
    • setExtraData

      public <U> void setExtraData(Class<U> dataType, U instance)
      Specified by:
      setExtraData in interface ReadableArchive
    • removeExtraData

      public <U> void removeExtraData(Class<U> dataType)
      Specified by:
      removeExtraData in interface ReadableArchive
    • addArchiveMetaData

      public void addArchiveMetaData(String metaDataKey, Object metaData)
      Specified by:
      addArchiveMetaData in interface ReadableArchive
    • getArchiveMetaData

      public <T> T getArchiveMetaData(String metaDataKey, Class<T> metadataType)
      Specified by:
      getArchiveMetaData in interface ReadableArchive
    • removeArchiveMetaData

      public void removeArchiveMetaData(String metaDataKey)
      Specified by:
      removeArchiveMetaData in interface ReadableArchive