Package com.atlassian.bamboo.util
Class RequestCacheThreadLocal
java.lang.Object
com.atlassian.bamboo.util.RequestCacheThreadLocal
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static void
This method should only be called from the RequestCacheThreadLocalFilterstatic @Nullable String
static @NotNull javax.servlet.http.HttpServletRequest
static @NotNull javax.servlet.http.HttpServletResponse
static @Nullable javax.servlet.http.HttpServletRequest
static @Nullable javax.servlet.http.HttpServletResponse
static void
setRequestCache
(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Initialise the threadlocal request cache.static void
update
(@NotNull javax.servlet.http.HttpServletRequest request)
-
Field Details
-
CONTEXT_PATH_KEY
- See Also:
-
-
Method Details
-
getRequestCache
-
setRequestCache
public static void setRequestCache(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) Initialise the threadlocal request cache.- Throws:
IllegalArgumentException
- in case XSS is suspected in the request
-
clearRequestCache
public static void clearRequestCache()This method should only be called from the RequestCacheThreadLocalFilter -
getContextPath
-
getRequest
@Nullable public static @Nullable javax.servlet.http.HttpServletRequest getRequest() -
getResponse
@Nullable public static @Nullable javax.servlet.http.HttpServletResponse getResponse() -
canRequestMutateState
public static boolean canRequestMutateState()- Returns:
- true iff we are in a request context and the request is allowed to mutate state
-
update
public static void update(@NotNull @NotNull javax.servlet.http.HttpServletRequest request) - Throws:
IllegalArgumentException
- in case XSS is suspected in the request
-
getNonNullRequest
@NotNull public static @NotNull javax.servlet.http.HttpServletRequest getNonNullRequest() -
getNonNullResponse
@NotNull public static @NotNull javax.servlet.http.HttpServletResponse getNonNullResponse()- Returns:
- current
HttpServletResponse
. ThrowsIllegalStateException
if called outside of HTTP request context
-