Clover Coverage Report - Atlassian Core
Coverage timestamp: Sun Nov 30 2008 18:33:35 CST
5   44   5   1
0   29   1   5
5     1  
1    
 
 
  ServletContextThreadLocal       Line # 7 5 5 0% 0.0
 
No Tests
 
1    package com.atlassian.core.filters;
2   
3    import javax.servlet.ServletContext;
4    import javax.servlet.http.HttpServletRequest;
5    import javax.servlet.http.HttpServletResponse;
6   
 
7    public class ServletContextThreadLocal
8    {
9    private static final ThreadLocal request = new ThreadLocal();
10    private static final ThreadLocal response = new ThreadLocal();
11   
 
12  0 toggle public static ServletContext getContext()
13    {
14  0 return getRequest().getSession().getServletContext();
15    }
16   
 
17  0 toggle public static HttpServletRequest getRequest()
18    {
19  0 return (HttpServletRequest) request.get();
20    }
21   
22    /**
23    * @deprecated since 2.16. This method is not longer a part of public API and
24    * should not be used from outside of <code>com.atlassian.core.filters</code> package.
25    * The visibility of this method will be changed to package private in the future;
26    * no replacement provided.
27    *
28    * @param httpRequest
29    */
 
30  0 toggle public static void setRequest(HttpServletRequest httpRequest)
31    {
32  0 request.set(httpRequest);
33    }
34   
 
35  0 toggle static void setResponse(HttpServletResponse httpResponse)
36    {
37  0 response.set(httpResponse);
38    }
39   
 
40  0 toggle public static HttpServletResponse getResponse()
41    {
42  0 return (HttpServletResponse) response.get();
43    }
44    }