Class JarResourceRoot

    • Constructor Detail

      • JarResourceRoot

        public JarResourceRoot​(WebResourceRoot root,
                               java.io.File base,
                               java.lang.String baseUrl,
                               java.lang.String webAppPath)
    • Method Detail

      • getLastModified

        public long getLastModified()
        Description copied from interface: WebResource
        Returns the last modified time.
        Returns:
        File.lastModified().
      • exists

        public boolean exists()
        Description copied from interface: WebResource
        Checks if this resource exists.
        Returns:
        File.exists().
      • isVirtual

        public boolean isVirtual()
        Description copied from interface: WebResource
        Indicates if this resource is required for applications to correctly scan the file structure but that does not exist in either the main or any additional WebResourceSet. For example, if an external directory is mapped to /WEB-INF/lib in an otherwise empty web application, /WEB-INF will be represented as a virtual resource.
        Returns:
        true for a virtual resource
      • isDirectory

        public boolean isDirectory()
        Description copied from interface: WebResource
        Checks if this resource is a directory.
        Returns:
        File.isDirectory().
      • isFile

        public boolean isFile()
        Description copied from interface: WebResource
        Checks if this resource is a file.
        Returns:
        File.isFile().
      • delete

        public boolean delete()
        Description copied from interface: WebResource
        Deletes this resource.
        Returns:
        File.delete().
      • getName

        public java.lang.String getName()
        Description copied from interface: WebResource
        Returns the name of this resource.
        Returns:
        File.getName().
      • getContentLength

        public long getContentLength()
        Description copied from interface: WebResource
        Returns the content length of this resource.
        Returns:
        File.length().
      • getCanonicalPath

        public java.lang.String getCanonicalPath()
        Description copied from interface: WebResource
        Returns the canonical path of this resource.
        Returns:
        File.getCanonicalPath().
      • canRead

        public boolean canRead()
        Description copied from interface: WebResource
        Checks if this resource can be read.
        Returns:
        File.canRead().
      • doGetInputStream

        protected java.io.InputStream doGetInputStream()
        Description copied from class: AbstractResource
        Returns the input stream for this resource.
        Specified by:
        doGetInputStream in class AbstractResource
        Returns:
        the input stream for this resource
      • getContent

        public byte[] getContent()
        Description copied from interface: WebResource
        Returns the binary content of this resource.
        Returns:
        the binary content of this resource or null if it is not available in a byte[] because, for example, it is too big.
      • getCreation

        public long getCreation()
        Description copied from interface: WebResource
        Returns the creation time of this resource.
        Returns:
        The time the file was created. If not available, the result of WebResource.getLastModified() will be returned.
      • getURL

        public java.net.URL getURL()
        Description copied from interface: WebResource
        Returns a URL to access this resource.
        Returns:
        a URL to access the resource or null if no such URL is available or if the resource does not exist.
      • getCodeBase

        public java.net.URL getCodeBase()
        Returns:
        the code base for this resource that will be used when looking up the assigned permissions for the code base in the security policy file when running under a security manager.
      • getCertificates

        public java.security.cert.Certificate[] getCertificates()
        Description copied from interface: WebResource
        Returns the certificates that were used to sign this resource to verify it.
        Returns:
        the certificates that were used to sign this resource to verify it or @null if none.
        See Also:
        JarEntry.getCertificates()
      • getManifest

        public java.util.jar.Manifest getManifest()
        Description copied from interface: WebResource
        Returns the manifest associated with this resource.
        Returns:
        the manifest associated with this resource or @null if none.
        See Also:
        JarFile.getManifest()