| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
package org.apache.tapestry5.util; |
| 16 | |
|
| 17 | |
import org.apache.tapestry5.Link; |
| 18 | |
import org.apache.tapestry5.ioc.internal.util.Defense; |
| 19 | |
import org.apache.tapestry5.services.Response; |
| 20 | |
|
| 21 | |
import java.io.IOException; |
| 22 | |
import java.io.OutputStream; |
| 23 | |
import java.io.PrintWriter; |
| 24 | |
|
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
public class ResponseWrapper implements Response |
| 30 | |
{ |
| 31 | |
protected final Response response; |
| 32 | |
|
| 33 | |
public ResponseWrapper(Response response) |
| 34 | 0 | { |
| 35 | 0 | Defense.notNull(response, "response"); |
| 36 | |
|
| 37 | 0 | this.response = response; |
| 38 | 0 | } |
| 39 | |
|
| 40 | |
public PrintWriter getPrintWriter(String contentType) throws IOException |
| 41 | |
{ |
| 42 | 0 | return response.getPrintWriter(contentType); |
| 43 | |
} |
| 44 | |
|
| 45 | |
public OutputStream getOutputStream(String contentType) throws IOException |
| 46 | |
{ |
| 47 | 0 | return response.getOutputStream(contentType); |
| 48 | |
} |
| 49 | |
|
| 50 | |
public void sendRedirect(String URL) throws IOException |
| 51 | |
{ |
| 52 | 0 | response.sendRedirect(URL); |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
public void sendRedirect(Link link) throws IOException |
| 56 | |
{ |
| 57 | 0 | response.sendRedirect(link); |
| 58 | 0 | } |
| 59 | |
|
| 60 | |
public void setStatus(int sc) |
| 61 | |
{ |
| 62 | 0 | response.setStatus(sc); |
| 63 | 0 | } |
| 64 | |
|
| 65 | |
public void sendError(int sc, String message) throws IOException |
| 66 | |
{ |
| 67 | 0 | response.sendError(sc, message); |
| 68 | 0 | } |
| 69 | |
|
| 70 | |
public void setContentLength(int length) |
| 71 | |
{ |
| 72 | 0 | response.setContentLength(length); |
| 73 | 0 | } |
| 74 | |
|
| 75 | |
public void setDateHeader(String name, long date) |
| 76 | |
{ |
| 77 | 0 | response.setDateHeader(name, date); |
| 78 | 0 | } |
| 79 | |
|
| 80 | |
public void setHeader(String name, String value) |
| 81 | |
{ |
| 82 | 0 | response.setHeader(name, value); |
| 83 | 0 | } |
| 84 | |
|
| 85 | |
public void setIntHeader(String name, int value) |
| 86 | |
{ |
| 87 | 0 | response.setIntHeader(name, value); |
| 88 | 0 | } |
| 89 | |
|
| 90 | |
public String encodeURL(String URL) |
| 91 | |
{ |
| 92 | 0 | return response.encodeURL(URL); |
| 93 | |
} |
| 94 | |
|
| 95 | |
public String encodeRedirectURL(String URL) |
| 96 | |
{ |
| 97 | 0 | return response.encodeRedirectURL(URL); |
| 98 | |
} |
| 99 | |
|
| 100 | |
public boolean isCommitted() |
| 101 | |
{ |
| 102 | 0 | return response.isCommitted(); |
| 103 | |
} |
| 104 | |
} |