Class ReadableArchiveAdapter

  • All Implemented Interfaces:
    Archive, ReadableArchive
    Direct Known Subclasses:
    ScatteredArchive

    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 Detail

      • ReadableArchiveAdapter

        public ReadableArchiveAdapter()
    • Method Detail

      • 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
      • 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
      • 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
      • 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.