All Downloads are FREE. Search and download functionalities are using the official Maven repository.

javax.portlet.filter.MimeResponseWrapper Maven / Gradle / Ivy

Go to download

The Java Portlet API version 3.0 developed by the Java Community Process JSR-362 Expert Group.

There is a newer version: 3.0.1
Show newest version
/*  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */

package javax.portlet.filter;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Locale;

import javax.portlet.ActionURL;
import javax.portlet.CacheControl;
import javax.portlet.MimeResponse;
import javax.portlet.PortletURL;
import javax.portlet.RenderURL;
import javax.portlet.ResourceURL;

/**
 * 
The MimeResponseWrapper provides * a convenient implementation of the MimeResponse interface that * can be subclassed by developers. This class * implements the Wrapper or Decorator pattern. Methods default to calling * through to the wrapped response object.
*/ public class MimeResponseWrapper extends PortletResponseWrapper implements MimeResponse { /** * @param response */ public MimeResponseWrapper(MimeResponse response) { super(response); } /** * Return the wrapped response object. * * @return the wrapped response */ public MimeResponse getResponse() { return (MimeResponse) super.getResponse(); } /** * Sets the response object being wrapped. * * @param response * the response to set * @throws java.lang.IllegalArgumentException * if the response is null. */ public void setResponse(MimeResponse response) { super.setResponse(response); } /** * The default behavior of this method is to call flushBuffer() * on the wrapped response object. */ public void flushBuffer() throws IOException { ((MimeResponse)response).flushBuffer(); } /** * The default behavior of this method is to call * getBufferSize() on the wrapped response object. */ public int getBufferSize() { return ((MimeResponse)response).getBufferSize(); } /** * The default behavior of this method is to call * getCharacterEncoding() on the wrapped response object. */ public String getCharacterEncoding() { return ((MimeResponse)response).getCharacterEncoding(); } /** * The default behavior of this method is to call * getContentType() on the wrapped response object. */ public String getContentType() { return ((MimeResponse)response).getContentType(); } /** * The default behavior of this method is to call getLocale() on * the wrapped response object. */ public Locale getLocale() { return ((MimeResponse)response).getLocale(); } /** * The default behavior of this method is to call * getPortletOutputStream() on the wrapped response object. */ public OutputStream getPortletOutputStream() throws IOException { return ((MimeResponse)response).getPortletOutputStream(); } /** * The default behavior of this method is to call getWriter() on * the wrapped response object. */ public PrintWriter getWriter() throws IOException { return ((MimeResponse)response).getWriter(); } /** * The default behavior of this method is to call isCommitted() * on the wrapped response object. */ public boolean isCommitted() { return ((MimeResponse)response).isCommitted(); } /** * The default behavior of this method is to call reset() on the * wrapped response object. */ public void reset() { ((MimeResponse)response).reset(); } /** * The default behavior of this method is to call resetBuffer() * on the wrapped response object. */ public void resetBuffer() { ((MimeResponse)response).resetBuffer(); } /** * The default behavior of this method is to call * setBufferSize(size) on the wrapped response object. */ public void setBufferSize(int size) { ((MimeResponse)response).setBufferSize(size); } /** * The default behavior of this method is to call * getCacheControl() on the wrapped response object. */ public CacheControl getCacheControl() { return ((MimeResponse)response).getCacheControl(); } /** * The default behavior of this method is to call * createActionURL() on the wrapped response object. */ public T createActionURL() throws IllegalStateException { return ((MimeResponse)response).createActionURL(); } /** * The default behavior of this method is to * call createActionURL(ParameterCopyOption) on the wrapped * response object. */ public ActionURL createActionURL(Copy option) throws IllegalStateException { return ((MimeResponse)response).createActionURL(option); } /** * The default behavior of this method is to call * createRenderURL() on the wrapped response object. */ public T createRenderURL() throws IllegalStateException { return ((MimeResponse)response).createRenderURL(); } /** * The default behavior of this method is to * call createRenderURL(ParameterCopyOption) on the wrapped * response object. */ public RenderURL createRenderURL(Copy option) throws IllegalStateException { return ((MimeResponse)response).createRenderURL(option); } /** * The default behavior of this method is to call * createResourceURL() on the wrapped response object. */ public ResourceURL createResourceURL() throws IllegalStateException { return ((MimeResponse)response).createResourceURL(); } /** * The default behavior of this method is to call * setContentType(type) on the wrapped response object. */ public void setContentType(String type) { ((MimeResponse)response).setContentType(type); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy