Class ResourceService


  • public class ResourceService
    extends java.lang.Object
    Abstract resource service, used by DefaultServlet and ResourceHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceService()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      org.eclipse.jetty.http.HttpField getCacheControl()  
      org.eclipse.jetty.http.HttpContent.ContentFactory getContentFactory()  
      int getEncodingCacheSize()  
      java.util.List<java.lang.String> getGzipEquivalentFileExtensions()  
      org.eclipse.jetty.http.CompressedContentFormat[] getPrecompressedFormats()  
      ResourceService.WelcomeFactory getWelcomeFactory()  
      boolean isAcceptRanges()  
      boolean isDirAllowed()  
      boolean isEtags()  
      protected boolean isGzippedContent​(java.lang.String path)  
      boolean isPathInfoOnly()  
      boolean isRedirectWelcome()  
      protected void notFound​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected boolean passConditionalHeaders​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.eclipse.jetty.http.HttpContent content)  
      protected void putHeaders​(javax.servlet.http.HttpServletResponse response, org.eclipse.jetty.http.HttpContent content, long contentLength)  
      protected boolean sendData​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean include, org.eclipse.jetty.http.HttpContent content, java.util.Enumeration<java.lang.String> reqRanges)  
      protected void sendDirectory​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.eclipse.jetty.util.resource.Resource resource, java.lang.String pathInContext)  
      protected void sendStatus​(javax.servlet.http.HttpServletResponse response, int status, java.util.function.Supplier<java.lang.String> etag)  
      protected void sendWelcome​(org.eclipse.jetty.http.HttpContent content, java.lang.String pathInContext, boolean endsWithSlash, boolean included, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      void setAcceptRanges​(boolean acceptRanges)  
      void setCacheControl​(org.eclipse.jetty.http.HttpField cacheControl)  
      void setContentFactory​(org.eclipse.jetty.http.HttpContent.ContentFactory contentFactory)  
      void setDirAllowed​(boolean dirAllowed)  
      void setEncodingCacheSize​(int encodingCacheSize)  
      void setEtags​(boolean etags)  
      void setGzipEquivalentFileExtensions​(java.util.List<java.lang.String> gzipEquivalentFileExtensions)  
      void setPathInfoOnly​(boolean pathInfoOnly)  
      void setPrecompressedFormats​(org.eclipse.jetty.http.CompressedContentFormat[] precompressedFormats)  
      void setRedirectWelcome​(boolean redirectWelcome)  
      void setWelcomeFactory​(ResourceService.WelcomeFactory welcomeFactory)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourceService

        public ResourceService()
    • Method Detail

      • getContentFactory

        public org.eclipse.jetty.http.HttpContent.ContentFactory getContentFactory()
      • setContentFactory

        public void setContentFactory​(org.eclipse.jetty.http.HttpContent.ContentFactory contentFactory)
      • isAcceptRanges

        public boolean isAcceptRanges()
      • setAcceptRanges

        public void setAcceptRanges​(boolean acceptRanges)
      • isDirAllowed

        public boolean isDirAllowed()
      • setDirAllowed

        public void setDirAllowed​(boolean dirAllowed)
      • isRedirectWelcome

        public boolean isRedirectWelcome()
      • setRedirectWelcome

        public void setRedirectWelcome​(boolean redirectWelcome)
      • getPrecompressedFormats

        public org.eclipse.jetty.http.CompressedContentFormat[] getPrecompressedFormats()
      • setPrecompressedFormats

        public void setPrecompressedFormats​(org.eclipse.jetty.http.CompressedContentFormat[] precompressedFormats)
      • setEncodingCacheSize

        public void setEncodingCacheSize​(int encodingCacheSize)
      • getEncodingCacheSize

        public int getEncodingCacheSize()
      • isPathInfoOnly

        public boolean isPathInfoOnly()
      • setPathInfoOnly

        public void setPathInfoOnly​(boolean pathInfoOnly)
      • isEtags

        public boolean isEtags()
      • setEtags

        public void setEtags​(boolean etags)
      • getCacheControl

        public org.eclipse.jetty.http.HttpField getCacheControl()
      • setCacheControl

        public void setCacheControl​(org.eclipse.jetty.http.HttpField cacheControl)
      • getGzipEquivalentFileExtensions

        public java.util.List<java.lang.String> getGzipEquivalentFileExtensions()
      • setGzipEquivalentFileExtensions

        public void setGzipEquivalentFileExtensions​(java.util.List<java.lang.String> gzipEquivalentFileExtensions)
      • doGet

        public boolean doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response)
                      throws javax.servlet.ServletException,
                             java.io.IOException
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • sendWelcome

        protected void sendWelcome​(org.eclipse.jetty.http.HttpContent content,
                                   java.lang.String pathInContext,
                                   boolean endsWithSlash,
                                   boolean included,
                                   javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response)
                            throws javax.servlet.ServletException,
                                   java.io.IOException
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • isGzippedContent

        protected boolean isGzippedContent​(java.lang.String path)
      • notFound

        protected void notFound​(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • sendStatus

        protected void sendStatus​(javax.servlet.http.HttpServletResponse response,
                                  int status,
                                  java.util.function.Supplier<java.lang.String> etag)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • passConditionalHeaders

        protected boolean passConditionalHeaders​(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 org.eclipse.jetty.http.HttpContent content)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendDirectory

        protected void sendDirectory​(javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response,
                                     org.eclipse.jetty.util.resource.Resource resource,
                                     java.lang.String pathInContext)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • sendData

        protected boolean sendData​(javax.servlet.http.HttpServletRequest request,
                                   javax.servlet.http.HttpServletResponse response,
                                   boolean include,
                                   org.eclipse.jetty.http.HttpContent content,
                                   java.util.Enumeration<java.lang.String> reqRanges)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • putHeaders

        protected void putHeaders​(javax.servlet.http.HttpServletResponse response,
                                  org.eclipse.jetty.http.HttpContent content,
                                  long contentLength)