1 7 package com.inversoft.junit.internal.http; 8 9 10 import java.io.InputStream ; 11 import java.net.URL ; 12 import java.net.MalformedURLException ; 13 import java.util.Enumeration ; 14 import java.util.Set ; 15 16 import javax.servlet.RequestDispatcher ; 17 import javax.servlet.Servlet ; 18 import javax.servlet.ServletContext ; 19 import javax.servlet.ServletException ; 20 21 22 35 public class ServletContextWrapper implements ServletContext { 36 37 40 protected ServletContext context; 41 42 43 48 public ServletContextWrapper(ServletContext context) { 49 this.context = context; 50 } 51 52 53 56 public ServletContext getWrappedContext() { 57 return context; 58 } 59 60 61 public Object getAttribute(String name) { 62 return context.getAttribute(name); 63 } 64 65 66 public Enumeration getAttributeNames() { 67 return context.getAttributeNames(); 68 } 69 70 71 public ServletContext getContext(String url) { 72 return context.getContext(url); 73 } 74 75 76 public String getInitParameter(String name) { 77 return context.getInitParameter(name); 78 } 79 80 81 public Enumeration getInitParameterNames() { 82 return context.getInitParameterNames(); 83 } 84 85 86 public int getMajorVersion() { 87 return context.getMajorVersion(); 88 } 89 90 91 public String getMimeType(String type) { 92 return context.getMimeType(type); 93 } 94 95 96 public int getMinorVersion() { 97 return context.getMinorVersion(); 98 } 99 100 101 public RequestDispatcher getNamedDispatcher(String name) { 102 return context.getNamedDispatcher(name); 103 } 104 105 106 public String getRealPath(String url) { 107 return context.getRealPath(url); 108 } 109 110 111 public RequestDispatcher getRequestDispatcher(String url) { 112 return context.getRequestDispatcher(url); 113 } 114 115 116 public URL getResource(String path) throws MalformedURLException { 117 return context.getResource(path); 118 } 119 120 121 public InputStream getResourceAsStream(String path) { 122 return context.getResourceAsStream(path); 123 } 124 125 126 public Set getResourcePaths(String path) { 127 return context.getResourcePaths(path); 128 } 129 130 131 public String getServerInfo() { 132 return context.getServerInfo(); 133 } 134 135 138 public Servlet getServlet(String name) throws ServletException { 139 return context.getServlet(name); 140 } 141 142 143 public String getServletContextName() { 144 return context.getServletContextName(); 145 } 146 147 150 public Enumeration getServletNames() { 151 return context.getServletNames(); 152 } 153 154 157 public Enumeration getServlets() { 158 return context.getServlets(); 159 } 160 161 164 public void log(Exception exception, String msg) { 165 context.log(exception, msg); 166 } 167 168 169 public void log(String msg) { 170 context.log(msg); 171 } 172 173 174 public void log(String msg, Throwable throwable) { 175 context.log(msg, throwable); 176 } 177 178 179 public void removeAttribute(String name) { 180 context.removeAttribute(name); 181 } 182 183 184 public void setAttribute(String name, Object value) { 185 context.setAttribute(name, value); 186 } 187 } 188 | Popular Tags |