Class ResourceService


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

      • ResourceService

        public ResourceService()
    • Method Detail

      • 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)
      • setPrecompressedFormats

        public void setPrecompressedFormats​(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 HttpField getCacheControl()
      • setCacheControl

        public void setCacheControl​(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​(jakarta.servlet.http.HttpServletRequest request,
                             jakarta.servlet.http.HttpServletResponse response)
                      throws jakarta.servlet.ServletException,
                             java.io.IOException
        Throws:
        jakarta.servlet.ServletException
        java.io.IOException
      • sendWelcome

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

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

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

        protected void sendStatus​(jakarta.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​(jakarta.servlet.http.HttpServletRequest request,
                                                 jakarta.servlet.http.HttpServletResponse response,
                                                 HttpContent content)
                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • sendDirectory

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

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

        protected void putHeaders​(jakarta.servlet.http.HttpServletResponse response,
                                  HttpContent content,
                                  long contentLength)