Class ZipRepository

    • Constructor Detail

      • ZipRepository

        public ZipRepository​(java.lang.String path)
                      throws java.util.zip.ZipException,
                             java.io.IOException
        Constructs a ZipRespository using the given zip file.
        Parameters:
        path - path to zip file
        Throws:
        java.util.zip.ZipException - a zip encoding related error occurred
        java.io.IOException - an I/O error occurred
      • ZipRepository

        public ZipRepository​(java.io.File file)
                      throws java.util.zip.ZipException,
                             java.io.IOException
        Constructs a ZipRespository using the given zip file.
        Parameters:
        file - zip file
        Throws:
        java.util.zip.ZipException - a zip encoding related error occurred
        java.io.IOException - an I/O error occurred
    • Method Detail

      • getZipFile

        protected java.util.zip.ZipFile getZipFile()
                                            throws java.io.IOException
        Returns a java.util.zip.ZipFile for this repository.
        Returns:
        a ZipFile for reading
        Throws:
        java.io.IOException - an I/O related error occurred
      • lookupResource

        protected Resource lookupResource​(java.lang.String name)
                                   throws java.io.IOException
        Called to create a child resource for this repository.
        Specified by:
        lookupResource in class AbstractRepository
        Parameters:
        name - the name of the child resource
        Returns:
        the child resource, or null if no resource with the given name exists
        Throws:
        java.io.IOException - an I/O error occurred
      • exists

        public boolean exists()
                       throws java.io.IOException
        Checks wether this resource actually (still) exists
        Returns:
        true if the resource exists
        Throws:
        java.io.IOException
      • createChildRepository

        protected AbstractRepository createChildRepository​(java.lang.String name)
                                                    throws java.io.IOException
        Description copied from class: AbstractRepository
        Create a new child reposiotory with the given name.
        Specified by:
        createChildRepository in class AbstractRepository
        Parameters:
        name - the name
        Returns:
        the new child repository
        Throws:
        java.io.IOException - an I/O error occurred
      • getResources

        protected void getResources​(java.util.List<Resource> list,
                                    boolean recursive)
                             throws java.io.IOException
        Description copied from class: AbstractRepository
        Add the repository's resources into the list, optionally descending into nested repositories.
        Specified by:
        getResources in class AbstractRepository
        Parameters:
        list - the list to add the resources to
        recursive - whether to descend into nested repositories
        Throws:
        java.io.IOException - an I/O related error occurred
      • getRepositories

        public Repository[] getRepositories()
                                     throws java.io.IOException
        Description copied from interface: Repository
        Returns this repository's direct child repositories
        Returns:
        direct repositories
        Throws:
        java.io.IOException - an I/O error occurred
      • getUrl

        public java.net.URL getUrl()
                            throws java.net.MalformedURLException
        Description copied from interface: Trackable
        Returns an url to the resource if the repository of this resource is able to provide urls.
        Returns:
        url to the resource
        Throws:
        java.net.MalformedURLException
      • lastModified

        public long lastModified()
        Description copied from interface: Trackable
        Returns the date the resource was last modified
        Returns:
        last modified date
      • getChecksum

        public long getChecksum()
        Description copied from interface: Trackable
        Checksum of the resource content. Implementations should make sure to return a different checksum if the resource's content has changed.
        Returns:
        checksum
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object