Class RequestCacheThreadLocal

java.lang.Object
com.atlassian.bamboo.util.RequestCacheThreadLocal

public class RequestCacheThreadLocal extends Object
  • Field Details

  • Method Details

    • getRequestCache

      @NotNull public static @NotNull Map<String,Object> 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

      @Nullable public static @Nullable String 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. Throws IllegalStateException if called outside of HTTP request context