Class CompositeArchive

    • Method Detail

      • getEntry

        public InputStream getEntry​(String name)
                             throws IOException
        Description copied from interface: ReadableArchive
        Returns the InputStream for 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.
        Returns:
        the InputStream for the given entry name or null if not found.
        Throws:
        IOException
      • exists

        public boolean exists​(String name)
                       throws IOException
        Description copied from interface: ReadableArchive
        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.
        Returns:
        the existence the given entry name.
        Throws:
        IOException
      • getEntrySize

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

        public ReadableArchive getSubArchive​(String name)
                                      throws IOException
        Description copied from interface: ReadableArchive
        Returns an instance of this archive abstraction for an embedded archive within this archive.
        Parameters:
        name - 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()
        Returns:
        true if this archive exists
      • delete

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

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

        public void close()
                   throws IOException
        Description copied from interface: Archive
        closes this archive and releases all resources
        Throws:
        IOException
      • 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.
        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.
        Parameters:
        prefix - the prefix of entries to be included
        Returns:
        an enumeration of the archive file entries.
      • isDirectory

        public boolean isDirectory​(String name)
        Description copied from interface: Archive
        Returns true if the entry is a directory or a plain file
        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
      • getManifest

        public Manifest getManifest()
                             throws IOException
        Description copied from interface: Archive
        Returns the manifest information for this archive
        Returns:
        the manifest info
        Throws:
        IOException
      • getURI

        public URI getURI()
        Description copied from interface: Archive
        Returns the path used to create or open the underlying archive

        TODO: abstraction breakage: Several callers, most notably DeploymentContext.getSourceDir() implementation, assumes that this URI is an URL, and in fact file URL.

        If this needs to be URL, use of URI is misleading. And furthermore, if its needs to be a file URL, this should be File.

        Returns:
        the path for this archive.
      • getArchiveSize

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

        public String getName()
        Description copied from interface: Archive
        Returns the name of the archive.

        Implementations should not return null.

        Returns:
        the name of the archive
      • getDirectories

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