Package com.google.gerrit.util.http
Class RequestUtil
- java.lang.Object
- 
- com.google.gerrit.util.http.RequestUtil
 
- 
 public class RequestUtil extends Object Utilities for manipulating HTTP request objects.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanacceptsGzipEncoding(javax.servlet.http.HttpServletRequest request)static StringgetEncodedPathInfo(javax.servlet.http.HttpServletRequest req)static ThrowablegetErrorTraceAttribute(javax.servlet.http.HttpServletRequest req)static StringgetRestPathWithoutIds(javax.servlet.http.HttpServletRequest req)Trims leading '/' and 'a/'.static voidsetErrorTraceAttribute(javax.servlet.http.HttpServletRequest req, Throwable t)
 
- 
- 
- 
Method Detail- 
setErrorTraceAttributepublic static void setErrorTraceAttribute(javax.servlet.http.HttpServletRequest req, Throwable t)
 - 
getErrorTraceAttributepublic static Throwable getErrorTraceAttribute(javax.servlet.http.HttpServletRequest req) 
 - 
getEncodedPathInfopublic static String getEncodedPathInfo(javax.servlet.http.HttpServletRequest req) - Returns:
- the same value as HttpServletRequest.getPathInfo(), but without decoding URL-encoded characters.
 
 - 
getRestPathWithoutIdspublic static String getRestPathWithoutIds(javax.servlet.http.HttpServletRequest req) Trims leading '/' and 'a/'. Removes the context path, but keeps the servlet path. Removes all IDs from the rest of the URI.The returned string is a good fit for cases where one wants the full context of the request without any identifiable data. For example: Logging or quota checks. Examples: - /a/accounts/self/detail => /accounts/detail
- /changes/123/revisions/current/detail => /changes/revisions/detail
- /changes/ => /changes
 
 - 
acceptsGzipEncodingpublic static boolean acceptsGzipEncoding(javax.servlet.http.HttpServletRequest request) 
 
- 
 
-