Class JarArchive

    • Constructor Detail

      • JarArchive

        public JarArchive()
    • Method Detail

      • entries

        public Enumeration<String> entries​(String prefix)
        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.
      • getName

        public String getName()
        Returns the name portion of the archive's URI.

        For JarArhive the name is all of the path that follows the last slash up to but not including the last dot.

        Here are some example archive names for the specified JarArchive paths:

        • /a/b/c/d.jar -> d
        • /a/b/c/d -> d
        • /x/y/z.html -> z
        Specified by:
        getName in interface Archive
        Returns:
        the name of the archive
      • getJarEntry

        protected abstract JarEntry getJarEntry​(String entryName)
      • exists

        public boolean exists​(String name)
                       throws IOException
        Returns the existence of the given entry name The file name must be relative to the root of the module.
        Parameters:
        name - the file name relative to the root of the module. * @return the existence the given entry name.
        Throws:
        IOException
      • isDirectory

        public boolean isDirectory​(String name)
        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)
        set the parent archive for this archive
        Parameters:
        parentArchive - the parent archive
      • getParentArchive

        public ReadableArchive getParentArchive()
        get the parent archive of this archive
        Returns:
        the parent archive
      • getExtraData

        public <U> U getExtraData​(Class<U> dataType)
        Returns any data that could have been calculated as part of the descriptor loading.
        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)
      • removeExtraData

        public <U> void removeExtraData​(Class<U> dataType)
      • addArchiveMetaData

        public void addArchiveMetaData​(String metaDataKey,
                                       Object metaData)
      • getArchiveMetaData

        public <T> T getArchiveMetaData​(String metaDataKey,
                                        Class<T> metadataType)
      • removeArchiveMetaData

        public void removeArchiveMetaData​(String metaDataKey)