KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > store > RequestHeaderStore


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

20 package org.apache.slide.projector.store;
21
22 import java.io.IOException JavaDoc;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25
26 import org.apache.slide.projector.Store;
27
28 public class RequestHeaderStore implements Store {
29     protected HttpServletRequest JavaDoc request;
30
31     public RequestHeaderStore(HttpServletRequest JavaDoc request) {
32         this.request = request;
33     }
34
35     public void put(String JavaDoc key, Object JavaDoc value, long timeout) throws IOException JavaDoc {
36         throw new IOException JavaDoc("Put operation is not supported by request-header store!");
37     }
38
39     public void put(String JavaDoc key, Object JavaDoc value) throws IOException JavaDoc {
40         throw new IOException JavaDoc("Put operation is not supported by request-header store!");
41     }
42
43     public Object JavaDoc get(String JavaDoc key) {
44         return request.getHeader(key);
45     }
46
47     public void dispose(String JavaDoc key) throws IOException JavaDoc {
48         throw new IOException JavaDoc("Dispose operation is not supported by request-header store!");
49     }
50 }
Popular Tags