001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.servlet;
016    
017    import java.io.IOException;
018    import java.io.PrintWriter;
019    
020    import java.util.Collection;
021    import java.util.Locale;
022    
023    import javax.servlet.ServletOutputStream;
024    import javax.servlet.http.Cookie;
025    import javax.servlet.http.HttpServletResponse;
026    
027    /**
028     * @author Shuyang Zhou
029     */
030    public class StubHttpServletResponse implements HttpServletResponse {
031    
032            @Override
033            public void addCookie(Cookie cookie) {
034                    throw new UnsupportedOperationException();
035            }
036    
037            @Override
038            public void addDateHeader(String name, long value) {
039                    throw new UnsupportedOperationException();
040            }
041    
042            @Override
043            public void addHeader(String name, String value) {
044                    throw new UnsupportedOperationException();
045            }
046    
047            @Override
048            public void addIntHeader(String name, int value) {
049                    throw new UnsupportedOperationException();
050            }
051    
052            @Override
053            public boolean containsHeader(String name) {
054                    throw new UnsupportedOperationException();
055            }
056    
057            /**
058             * @deprecated As of 7.0.0
059             */
060            @Deprecated
061            @Override
062            public String encodeRedirectUrl(String url) {
063                    throw new UnsupportedOperationException();
064            }
065    
066            @Override
067            public String encodeRedirectURL(String url) {
068                    throw new UnsupportedOperationException();
069            }
070    
071            /**
072             * @deprecated As of 7.0.0
073             */
074            @Deprecated
075            @Override
076            public String encodeUrl(String string) {
077                    throw new UnsupportedOperationException();
078            }
079    
080            @Override
081            public String encodeURL(String string) {
082                    throw new UnsupportedOperationException();
083            }
084    
085            @Override
086            @SuppressWarnings("unused")
087            public void flushBuffer() throws IOException {
088                    throw new UnsupportedOperationException();
089            }
090    
091            @Override
092            public int getBufferSize() {
093                    throw new UnsupportedOperationException();
094            }
095    
096            @Override
097            public String getCharacterEncoding() {
098                    throw new UnsupportedOperationException();
099            }
100    
101            @Override
102            public String getContentType() {
103                    throw new UnsupportedOperationException();
104            }
105    
106            @Override
107            public String getHeader(String name) {
108                    throw new UnsupportedOperationException();
109            }
110    
111            @Override
112            public Collection<String> getHeaderNames() {
113                    throw new UnsupportedOperationException();
114            }
115    
116            @Override
117            public Collection<String> getHeaders(String name) {
118                    throw new UnsupportedOperationException();
119            }
120    
121            @Override
122            public Locale getLocale() {
123                    throw new UnsupportedOperationException();
124            }
125    
126            @Override
127            @SuppressWarnings("unused")
128            public ServletOutputStream getOutputStream() throws IOException {
129                    throw new UnsupportedOperationException();
130            }
131    
132            @Override
133            public int getStatus() {
134                    throw new UnsupportedOperationException();
135            }
136    
137            @Override
138            @SuppressWarnings("unused")
139            public PrintWriter getWriter() throws IOException {
140                    throw new UnsupportedOperationException();
141            }
142    
143            @Override
144            public boolean isCommitted() {
145                    throw new UnsupportedOperationException();
146            }
147    
148            @Override
149            public void reset() {
150                    throw new UnsupportedOperationException();
151            }
152    
153            @Override
154            public void resetBuffer() {
155                    throw new UnsupportedOperationException();
156            }
157    
158            @Override
159            @SuppressWarnings("unused")
160            public void sendError(int status) throws IOException {
161                    throw new UnsupportedOperationException();
162            }
163    
164            @Override
165            @SuppressWarnings("unused")
166            public void sendError(int status, String message) throws IOException {
167                    throw new UnsupportedOperationException();
168            }
169    
170            @Override
171            @SuppressWarnings("unused")
172            public void sendRedirect(String location) throws IOException {
173                    throw new UnsupportedOperationException();
174            }
175    
176            @Override
177            public void setBufferSize(int bufferSzie) {
178                    throw new UnsupportedOperationException();
179            }
180    
181            @Override
182            public void setCharacterEncoding(String characterEncoding) {
183                    throw new UnsupportedOperationException();
184            }
185    
186            @Override
187            public void setContentLength(int contentLength) {
188                    throw new UnsupportedOperationException();
189            }
190    
191            @Override
192            public void setContentType(String contentType) {
193                    throw new UnsupportedOperationException();
194            }
195    
196            @Override
197            public void setDateHeader(String name, long value) {
198                    throw new UnsupportedOperationException();
199            }
200    
201            @Override
202            public void setHeader(String name, String value) {
203                    throw new UnsupportedOperationException();
204            }
205    
206            @Override
207            public void setIntHeader(String name, int value) {
208                    throw new UnsupportedOperationException();
209            }
210    
211            @Override
212            public void setLocale(Locale locale) {
213                    throw new UnsupportedOperationException();
214            }
215    
216            @Override
217            public void setStatus(int status) {
218                    throw new UnsupportedOperationException();
219            }
220    
221            /**
222             * @deprecated As of 7.0.0
223             */
224            @Deprecated
225            @Override
226            public void setStatus(int status, String message) {
227                    throw new UnsupportedOperationException();
228            }
229    
230    }