Package org.eclipse.jetty.server
Class ResourceService
java.lang.Object
org.eclipse.jetty.server.ResourceService
Abstract resource service, used by DefaultServlet and ResourceHandler
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doGet
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) int
boolean
boolean
boolean
isEtags()
protected boolean
isGzippedContent
(String path) boolean
boolean
protected void
notFound
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) protected boolean
passConditionalHeaders
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, HttpContent content) protected void
putHeaders
(jakarta.servlet.http.HttpServletResponse response, HttpContent content, long contentLength) protected boolean
sendData
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean include, HttpContent content, Enumeration<String> reqRanges) protected void
sendDirectory
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Resource resource, String pathInContext) protected void
sendStatus
(jakarta.servlet.http.HttpServletResponse response, int status, Supplier<String> etag) protected void
sendWelcome
(HttpContent content, String pathInContext, boolean endsWithSlash, boolean included, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) void
setAcceptRanges
(boolean acceptRanges) void
setCacheControl
(HttpField cacheControl) void
setContentFactory
(HttpContent.ContentFactory contentFactory) void
setDirAllowed
(boolean dirAllowed) void
setEncodingCacheSize
(int encodingCacheSize) void
setEtags
(boolean etags) void
setGzipEquivalentFileExtensions
(List<String> gzipEquivalentFileExtensions) void
setPathInfoOnly
(boolean pathInfoOnly) void
setPrecompressedFormats
(CompressedContentFormat[] precompressedFormats) void
setRedirectWelcome
(boolean redirectWelcome) void
setWelcomeFactory
(ResourceService.WelcomeFactory welcomeFactory)
-
Constructor Details
-
ResourceService
public ResourceService()
-
-
Method Details
-
getContentFactory
-
setContentFactory
-
getWelcomeFactory
-
setWelcomeFactory
-
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
-
setPrecompressedFormats
-
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
-
setCacheControl
-
getGzipEquivalentFileExtensions
-
setGzipEquivalentFileExtensions
-
doGet
public boolean doGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Throws:
jakarta.servlet.ServletException
IOException
-
sendWelcome
protected void sendWelcome(HttpContent content, String pathInContext, boolean endsWithSlash, boolean included, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws jakarta.servlet.ServletException, IOException - Throws:
jakarta.servlet.ServletException
IOException
-
isGzippedContent
-
notFound
protected void notFound(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException - Throws:
IOException
-
sendStatus
protected void sendStatus(jakarta.servlet.http.HttpServletResponse response, int status, Supplier<String> etag) throws IOException - Throws:
IOException
-
passConditionalHeaders
protected boolean passConditionalHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, HttpContent content) throws IOException - Throws:
IOException
-
sendDirectory
protected void sendDirectory(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Resource resource, String pathInContext) throws IOException - Throws:
IOException
-
sendData
protected boolean sendData(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, boolean include, HttpContent content, Enumeration<String> reqRanges) throws IOException - Throws:
IOException
-
putHeaders
protected void putHeaders(jakarta.servlet.http.HttpServletResponse response, HttpContent content, long contentLength)
-