1/*2 * $Id: MimeResponseDelegate.java 1066849 2011-02-03 16:12:39Z apetrelli $3 *4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */21package org.apache.tiles.request.portlet.delegate;
2223import java.io.IOException;
24import java.io.OutputStream;
25import java.io.PrintWriter;
26import java.io.Writer;
2728import javax.portlet.MimeResponse;
2930/**31 * Response delegate in case of {@link MimeResponse}.32 *33 * @version $Rev: 1066849 $ $Date: 2011-02-04 03:12:39 +1100 (Fri, 04 Feb 2011) $34 */35publicclassMimeResponseDelegateimplementsResponseDelegate {
3637/**38 * The response.39 */40private MimeResponse response;
4142/**43 * Constructor.44 *45 * @param response The response.46 */47publicMimeResponseDelegate(MimeResponse response) {
48this.response = response;
49 }
5051/** {@inheritDoc} */52public OutputStream getOutputStream() throws IOException {
53return response.getPortletOutputStream();
54 }
5556/** {@inheritDoc} */57public PrintWriter getPrintWriter() throws IOException {
58return response.getWriter();
59 }
6061/** {@inheritDoc} */62public Writer getWriter() throws IOException {
63return response.getWriter();
64 }
6566/** {@inheritDoc} */67publicboolean isResponseCommitted() {
68return response.isCommitted();
69 }
7071/** {@inheritDoc} */72publicvoid setContentType(String contentType) {
73 response.setContentType(contentType);
74 }
75 }