Class UniversalClasspathResource

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

    public class UniversalClasspathResource
    extends org.eclipse.jetty.util.resource.Resource
    Single resource that can handle all items in classpath.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String path
      The path of the resource (relative to classpath, e.g. package directory).
      • Fields inherited from class org.eclipse.jetty.util.resource.Resource

        __defaultUseCaches
    • Constructor Summary

      Constructors 
      Constructor Description
      UniversalClasspathResource​(java.lang.String rootpath)
      Create a resource for the given path in classpath.
    • Method Summary

      All 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 exists()  
      java.io.File getFile()  
      java.io.InputStream getInputStream()  
      java.lang.String getName()  
      java.nio.channels.ReadableByteChannel getReadableByteChannel()  
      java.net.URL getURL()  
      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)  
      • Methods inherited from class org.eclipse.jetty.util.resource.Resource

        copyTo, encode, finalize, getAlias, getAllResources, getAssociate, getDefaultUseCaches, getListHTML, getListHTML, getResource, getURI, getWeakETag, getWeakETag, isAlias, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, release, setAssociate, setDefaultUseCaches, toURL, writeTo
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • path

        protected java.lang.String path
        The path of the resource (relative to classpath, e.g. package directory).
    • Constructor Detail

      • UniversalClasspathResource

        public UniversalClasspathResource​(java.lang.String rootpath)
        Create a resource for the given path in classpath.
    • Method Detail

      • 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
      • getURL

        public java.net.URL getURL()
        Specified by:
        getURL in class org.eclipse.jetty.util.resource.Resource
      • 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
      • 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
      • list

        public java.lang.String[] list()
        Specified by:
        list in class org.eclipse.jetty.util.resource.Resource
      • 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
      • 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
      • delete

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

        public boolean exists()
        Specified by:
        exists 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
      • 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
      • getName

        public java.lang.String getName()
        Specified by:
        getName in class org.eclipse.jetty.util.resource.Resource
      • 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