KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > environment > wrapper > ResponseWrapper


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.environment.wrapper;
17
18 import java.util.Locale JavaDoc;
19
20 import org.apache.cocoon.environment.Cookie;
21 import org.apache.cocoon.environment.Response;
22
23 /**
24  * This is a wrapper class for the Response object.
25  * It contains the same properties as the wrapped instance
26  * but swallows calls that would modify response headers.
27  */

28 public class ResponseWrapper implements Response {
29
30     private Response res;
31     
32     public ResponseWrapper(Response response) {
33         this.res = response;
34     }
35
36     public String JavaDoc getCharacterEncoding() {
37         return res.getCharacterEncoding();
38     }
39
40     public void setLocale(Locale JavaDoc loc) {
41         res.setLocale(loc);
42     }
43
44     public Locale JavaDoc getLocale() {
45         return res.getLocale();
46     }
47
48     public Cookie createCookie(String JavaDoc name, String JavaDoc value) {
49         return res.createCookie(name, value);
50     }
51
52     public void addCookie(Cookie cookie) {
53         res.addCookie(cookie);
54     }
55
56     public String JavaDoc encodeURL(String JavaDoc url) {
57         return res.encodeURL(url);
58     }
59
60     public boolean containsHeader(String JavaDoc name) {
61         return res.containsHeader(name);
62     }
63
64     public void setDateHeader(String JavaDoc name, long date) {
65     }
66
67     public void addDateHeader(String JavaDoc name, long date) {
68     }
69
70     public void setHeader(String JavaDoc name, String JavaDoc value) {
71     }
72
73     public void addHeader(String JavaDoc name, String JavaDoc value) {
74     }
75
76     public void setIntHeader(String JavaDoc name, int value) {
77     }
78
79     public void addIntHeader(String JavaDoc name, int value) {
80     }
81
82 }
83
Popular Tags