001
014
015 package com.liferay.portlet;
016
017 import java.io.BufferedReader;
018 import java.io.IOException;
019 import java.io.InputStream;
020 import java.io.UnsupportedEncodingException;
021
022 import javax.portlet.ClientDataRequest;
023
024
027 public abstract class ClientDataRequestImpl
028 extends PortletRequestImpl implements ClientDataRequest {
029
030 public String getCharacterEncoding() {
031 return getHttpServletRequest().getCharacterEncoding();
032 }
033
034 public int getContentLength() {
035 return getHttpServletRequest().getContentLength();
036 }
037
038 public String getContentType() {
039 return getHttpServletRequest().getContentType();
040 }
041
042 @Override
043 public String getMethod() {
044 return getHttpServletRequest().getMethod();
045 }
046
047 public InputStream getPortletInputStream() throws IOException {
048 return getHttpServletRequest().getInputStream();
049 }
050
051 public BufferedReader getReader()
052 throws IOException, UnsupportedEncodingException {
053
054 _calledGetReader = true;
055
056 return getHttpServletRequest().getReader();
057 }
058
059 public void setCharacterEncoding(String enc)
060 throws UnsupportedEncodingException {
061
062 if (_calledGetReader) {
063 throw new IllegalStateException();
064 }
065
066 getHttpServletRequest().setCharacterEncoding(enc);
067 }
068
069 private boolean _calledGetReader;
070
071 }