View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.webapp.filter.portlet;
20  
21  import java.io.BufferedReader;
22  import java.io.IOException;
23  import java.io.InputStream;
24  import java.io.UnsupportedEncodingException;
25  
26  import javax.portlet.ActionRequest;
27  import javax.portlet.PortletRequest;
28  
29  /**
30   * <p>
31   * NOTE: This class should be used(instantiated) only by 
32   * TomahawkFacesContextWrapper. By that reason, it could change
33   * in the future.
34   * </p>
35   * 
36   * @since 1.1.8
37   * @author Leonardo Uribe (latest modification by $Author: lu4242 $)
38   * @version $Revision: 782179 $ $Date: 2009-06-05 20:35:54 -0500 (Fri, 05 Jun 2009) $
39   */
40  public class ActionRequestWrapper extends PortletRequestWrapper
41      implements ActionRequest
42  {
43  
44      public ActionRequestWrapper(PortletRequest request)
45      {
46          super(request);
47      }
48      
49      private ActionRequest _getActionRequest()
50      {
51          return (ActionRequest)super.getRequest();
52      }
53  
54      public String getCharacterEncoding()
55      {
56          return _getActionRequest().getCharacterEncoding();
57      }
58  
59      public int getContentLength()
60      {
61          return _getActionRequest().getContentLength();
62      }
63  
64      public String getContentType()
65      {
66          return _getActionRequest().getContentType();
67      }
68  
69      public InputStream getPortletInputStream() throws IOException
70      {
71          return _getActionRequest().getPortletInputStream();
72      }
73  
74      public BufferedReader getReader() throws UnsupportedEncodingException,
75              IOException
76      {
77          return _getActionRequest().getReader();
78      }
79  
80      public void setCharacterEncoding(String s)
81              throws UnsupportedEncodingException
82      {
83          _getActionRequest().setCharacterEncoding(s);
84      }    
85  
86  }