Class ControlledCacheResource

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.eclipse.jetty.util.resource.ResourceFactory

    public class ControlledCacheResource
    extends org.eclipse.jetty.util.resource.Resource
    Simple wrapper around the Jetty Resource type, to grant us control over caching features. The current implementation only removes the last-modified value, but a future version could provide a "real" weak/strong etag.
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.util.resource.Resource

        __defaultUseCaches
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.jetty.util.resource.Resource addPath​(java.lang.String path)  
      void close()  
      boolean delete()  
      boolean equals​(java.lang.Object obj)  
      boolean exists()  
      java.io.File getFile()  
      java.io.InputStream getInputStream()  
      java.lang.String getName()  
      java.nio.channels.ReadableByteChannel getReadableByteChannel()  
      java.net.URI getURI()  
      int hashCode()  
      boolean isContainedIn​(org.eclipse.jetty.util.resource.Resource r)  
      boolean isDirectory()  
      long lastModified()  
      long length()  
      java.lang.String[] list()  
      boolean renameTo​(org.eclipse.jetty.util.resource.Resource dest)  
      java.lang.String toString()  
      static ControlledCacheResource wrap​(org.eclipse.jetty.util.resource.Resource wrapped)  
      • Methods inherited from class org.eclipse.jetty.util.resource.Resource

        copyTo, fromList, fromList, getAlias, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getResource, getWeakETag, getWeakETag, isAlias, isContainedIn, isSame, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, resolveAlias, setAssociate, setDefaultUseCaches, toURL
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isContainedIn

        public boolean isContainedIn​(org.eclipse.jetty.util.resource.Resource r)
                              throws java.net.MalformedURLException
        Specified by:
        isContainedIn in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.net.MalformedURLException
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class org.eclipse.jetty.util.resource.Resource
      • exists

        public boolean exists()
        Specified by:
        exists in class org.eclipse.jetty.util.resource.Resource
      • isDirectory

        public boolean isDirectory()
        Specified by:
        isDirectory in class org.eclipse.jetty.util.resource.Resource
      • lastModified

        public long lastModified()
        Specified by:
        lastModified in class org.eclipse.jetty.util.resource.Resource
      • length

        public long length()
        Specified by:
        length in class org.eclipse.jetty.util.resource.Resource
      • getURI

        public java.net.URI getURI()
        Specified by:
        getURI in class org.eclipse.jetty.util.resource.Resource
      • getFile

        public java.io.File getFile()
                             throws java.io.IOException
        Specified by:
        getFile in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.io.IOException
      • getName

        public java.lang.String getName()
        Specified by:
        getName in class org.eclipse.jetty.util.resource.Resource
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Specified by:
        getInputStream in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.io.IOException
      • getReadableByteChannel

        public java.nio.channels.ReadableByteChannel getReadableByteChannel()
                                                                     throws java.io.IOException
        Specified by:
        getReadableByteChannel in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.io.IOException
      • delete

        public boolean delete()
                       throws java.lang.SecurityException
        Specified by:
        delete in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.lang.SecurityException
      • renameTo

        public boolean renameTo​(org.eclipse.jetty.util.resource.Resource dest)
                         throws java.lang.SecurityException
        Specified by:
        renameTo in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.lang.SecurityException
      • list

        public java.lang.String[] list()
        Specified by:
        list in class org.eclipse.jetty.util.resource.Resource
      • addPath

        public org.eclipse.jetty.util.resource.Resource addPath​(java.lang.String path)
                                                         throws java.io.IOException,
                                                                java.net.MalformedURLException
        Specified by:
        addPath in class org.eclipse.jetty.util.resource.Resource
        Throws:
        java.io.IOException
        java.net.MalformedURLException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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