org.xwiki.portlet.view
Class StreamFilterManager

java.lang.Object
  extended by org.xwiki.portlet.view.StreamFilterManager

public class StreamFilterManager
extends Object

Applies the right stream filter based on the stream content type.

Version:
$Id: 0dcdd4f74abdd65ea343d55a8799608ba613f763 $

Constructor Summary
StreamFilterManager(DispatchURLFactory dispatchURLFactory, String contextPath, String portletNamespace, RequestType requestType)
          Creates a new StreamFilter manager that uses the given portlet URL factory and the given portlet name-space.
StreamFilterManager(javax.servlet.http.HttpServletRequest request)
          Creates a new StreamFilter manager for the given servlet request.
StreamFilterManager(javax.portlet.PortletRequest request, javax.portlet.MimeResponse response, String dispatchURL)
          Creates a new StreamFilter manager for the given portlet request and response.
 
Method Summary
 void filter(String contentType, Reader reader, Writer writer)
          Applies the right stream filter based on the given content type.
 Set<String> getKnownMimeTypes()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamFilterManager

public StreamFilterManager(javax.servlet.http.HttpServletRequest request)
Creates a new StreamFilter manager for the given servlet request.

Parameters:
request - the servlet request whose response will be filtered

StreamFilterManager

public StreamFilterManager(javax.portlet.PortletRequest request,
                           javax.portlet.MimeResponse response,
                           String dispatchURL)
Creates a new StreamFilter manager for the given portlet request and response.

Parameters:
request - the portlet request
response - the portlet response
dispatchURL - the URL where the request will be dispatched

StreamFilterManager

public StreamFilterManager(DispatchURLFactory dispatchURLFactory,
                           String contextPath,
                           String portletNamespace,
                           RequestType requestType)
Creates a new StreamFilter manager that uses the given portlet URL factory and the given portlet name-space.

Parameters:
dispatchURLFactory - the object used to create portlet URLs
contextPath - the servlet context path, used to determine relative servlet URLs
portletNamespace - the string used to name-space HTML element identifiers in the context of the portal page
requestType - the type of the current request
Method Detail

filter

public void filter(String contentType,
                   Reader reader,
                   Writer writer)
Applies the right stream filter based on the given content type.

Parameters:
contentType - the stream content type
reader - the character stream to be filtered
writer - the resulting character stream

getKnownMimeTypes

public Set<String> getKnownMimeTypes()
Returns:
the set of mime types known by this filter manager, i.e. the set of mime types for which there is a registered filter


Copyright © 2004-2013 XWiki. All Rights Reserved.