Package org.apache.solr.servlet
Class ServletUtils
- java.lang.Object
- 
- org.apache.solr.servlet.ServletUtils
 
- 
 public abstract class ServletUtils extends Object Various Util methods for interaction on servlet level, i.e. HttpServletRequest
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classServletUtils.ClosedServletInputStreamstatic classServletUtils.ClosedServletOutputStream
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description protected static io.opentracing.SpanbuildSpan(io.opentracing.Tracer tracer, javax.servlet.http.HttpServletRequest request)static javax.servlet.http.HttpServletRequestcloseShield(javax.servlet.http.HttpServletRequest request, boolean retry)Wrap the request's input stream with a close shield.static javax.servlet.http.HttpServletResponsecloseShield(javax.servlet.http.HttpServletResponse response, boolean retry)Wrap the response's output stream with a close shield.static StringgetPathAfterContext(javax.servlet.http.HttpServletRequest request)Use this to get the full path after context path "/solr", which is a combination of servletPath and pathInfo.
 
- 
- 
- 
Method Detail- 
getPathAfterContextpublic static String getPathAfterContext(javax.servlet.http.HttpServletRequest request) Use this to get the full path after context path "/solr", which is a combination of servletPath and pathInfo.- Parameters:
- request- the HttpServletRequest object
- Returns:
- String with path starting with a "/", or empty string if no path
 
 - 
closeShieldpublic static javax.servlet.http.HttpServletRequest closeShield(javax.servlet.http.HttpServletRequest request, boolean retry)Wrap the request's input stream with a close shield. If this is a retry, we will assume that the stream has already been wrapped and do nothing.Only the container should ever actually close the servlet output stream. This method possibly should be turned into a servlet filter - Parameters:
- request- The request to wrap.
- retry- If this is an original request or a retry.
- Returns:
- A request object with an InputStreamthat will ignore calls to close.
 
 - 
closeShieldpublic static javax.servlet.http.HttpServletResponse closeShield(javax.servlet.http.HttpServletResponse response, boolean retry)Wrap the response's output stream with a close shield. If this is a retry, we will assume that the stream has already been wrapped and do nothing.Only the container should ever actually close the servlet request stream. - Parameters:
- response- The response to wrap.
- retry- If this response corresponds to an original request or a retry.
- Returns:
- A response object with an OutputStreamthat will ignore calls to close.
 
 - 
buildSpanprotected static io.opentracing.Span buildSpan(io.opentracing.Tracer tracer, javax.servlet.http.HttpServletRequest request)
 
- 
 
-