1 9 package org.jboss.portal.portlet.impl; 10 11 import java.io.IOException ; 12 import java.io.OutputStream ; 13 import java.io.PrintWriter ; 14 import java.util.Locale ; 15 16 import javax.portlet.RenderResponse; 17 import javax.servlet.ServletOutputStream ; 18 import javax.servlet.http.Cookie ; 19 import javax.servlet.http.HttpServletResponse ; 20 21 import org.jboss.portal.server.PortalResponse; 22 23 27 public class DispatchedHttpServletResponse implements HttpServletResponse 28 { 29 30 private PortalResponse presp; 31 private RenderResponse rresp; 32 private HttpServletResponse hresp; 33 private ServletOutputStream sos; 34 35 public DispatchedHttpServletResponse(PortalResponse presp, RenderResponse rresp, HttpServletResponse hresp) 36 { 37 this.presp = presp; 38 this.rresp = rresp; 39 this.hresp = hresp; 40 this.sos = null; 41 } 42 43 45 public String encodeRedirectURL(String s) 46 { 47 return null; 48 } 49 50 public String encodeRedirectUrl(String s) 51 { 52 return null; 53 } 54 55 57 public String getCharacterEncoding() 58 { 59 return rresp.getCharacterEncoding(); 60 } 61 62 public void setBufferSize(int i) 63 { 64 rresp.setBufferSize(i); 65 } 66 67 public void flushBuffer() throws IOException 68 { 69 rresp.flushBuffer(); 70 } 71 72 public void resetBuffer() 73 { 74 rresp.resetBuffer(); 75 } 76 77 public void reset() 78 { 79 rresp.reset(); 80 } 81 82 public int getBufferSize() 83 { 84 return rresp.getBufferSize(); 85 } 86 87 public boolean isCommitted() 88 { 89 return rresp.isCommitted(); 90 } 91 92 public ServletOutputStream getOutputStream() throws IOException 93 { 94 if (sos == null) 95 { 96 sos = new ServletOutputStream () 97 { 98 private OutputStream out = rresp.getPortletOutputStream(); 99 public void write(byte b[], int off, int len) throws IOException 100 { 101 out.write(b, off, len); 102 } 103 public void write(byte b[]) throws IOException 104 { 105 out.write(b); 106 } 107 public void write(int b) throws IOException 108 { 109 out.write(b); 110 } 111 }; 112 } 113 return sos; 114 } 115 116 public PrintWriter getWriter() throws IOException 117 { 118 return rresp.getWriter(); 119 } 120 121 public String encodeURL(String s) 122 { 123 return rresp.encodeURL(s); 124 } 125 126 public String encodeUrl(String s) 127 { 128 return rresp.encodeURL(s); 129 } 130 131 133 public void setContentType(String s) 134 { 135 } 136 137 public void setContentLength(int i) 138 { 139 } 140 141 public void setLocale(Locale locale) 142 { 143 } 144 145 public void addCookie(Cookie cookie) 146 { 147 } 148 149 public void sendError(int i) throws IOException 150 { 151 } 152 153 public void sendError(int i, String s) throws IOException 154 { 155 } 156 157 public void sendRedirect(String s) throws IOException 158 { 159 } 160 161 public void setDateHeader(String s, long l) 162 { 163 } 164 165 public void addDateHeader(String s, long l) 166 { 167 } 168 169 public void setHeader(String s, String s1) 170 { 171 } 172 173 public void addHeader(String s, String s1) 174 { 175 } 176 177 public void setIntHeader(String s, int i) 178 { 179 } 180 181 public void addIntHeader(String s, int i) 182 { 183 } 184 185 public void setStatus(int i) 186 { 187 } 188 189 public void setStatus(int i, String s) 190 { 191 } 192 193 public boolean containsHeader(String s) 194 { 195 return false; 197 } 198 199 201 public Locale getLocale() 202 { 203 return rresp.getLocale(); 204 } 205 206 208 public String getContentType() 209 { 210 throw new UnsupportedOperationException ("Not specified by spec"); 211 } 212 213 public void setCharacterEncoding(String s) 214 { 215 throw new UnsupportedOperationException ("Not specified by spec"); 216 } 217 } 218 219 | Popular Tags |