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 @Override
031 public String getCharacterEncoding() {
032 return getHttpServletRequest().getCharacterEncoding();
033 }
034
035 @Override
036 public int getContentLength() {
037 return getHttpServletRequest().getContentLength();
038 }
039
040 @Override
041 public String getContentType() {
042 return getHttpServletRequest().getContentType();
043 }
044
045 @Override
046 public String getMethod() {
047 return getHttpServletRequest().getMethod();
048 }
049
050 @Override
051 public InputStream getPortletInputStream() throws IOException {
052 return getHttpServletRequest().getInputStream();
053 }
054
055 @Override
056 public BufferedReader getReader()
057 throws IOException, UnsupportedEncodingException {
058
059 _calledGetReader = true;
060
061 return getHttpServletRequest().getReader();
062 }
063
064 @Override
065 public void setCharacterEncoding(String enc)
066 throws UnsupportedEncodingException {
067
068 if (_calledGetReader) {
069 throw new IllegalStateException();
070 }
071
072 getHttpServletRequest().setCharacterEncoding(enc);
073 }
074
075 private boolean _calledGetReader;
076
077 }