com.liferay.faces.util.application
Class ResourceHandlerWrapperBase

java.lang.Object
  extended by javax.faces.application.ResourceHandler
      extended by javax.faces.application.ResourceHandlerWrapper
          extended by com.liferay.faces.util.application.ResourceHandlerWrapperBase
All Implemented Interfaces:
javax.faces.FacesWrapper<javax.faces.application.ResourceHandler>

public class ResourceHandlerWrapperBase
extends javax.faces.application.ResourceHandlerWrapper

This is an abstract class provides base functionality for a ResourceHandler that can write the contents of a Resource to the underlying response.

Author:
Neil Griffin

Field Summary
static int DEFAULT_BUFFER_SIZE
           
 
Fields inherited from class javax.faces.application.ResourceHandler
LOCALE_PREFIX, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER
 
Constructor Summary
ResourceHandlerWrapperBase(javax.faces.application.ResourceHandler resourceHandler)
           
 
Method Summary
protected  int getBufferSize(javax.faces.context.FacesContext facesContext)
           
protected  ResourceOutputStream getResourceOutputStream(javax.faces.application.Resource resource, int size)
          This is a factory-style method that returns a ResourceOutputStream for the specified Resource.
 javax.faces.application.ResourceHandler getWrapped()
           
protected  void handleResource(javax.faces.context.FacesContext facesContext, javax.faces.application.Resource resource)
           
 void handleResourceRequest(javax.faces.context.FacesContext facesContext)
          This method handles the current request which is assumed to be a request for a Resource.
protected  boolean isAbleToSetHttpStatusCode(javax.faces.context.FacesContext facesContext)
           
static boolean isEncodedFacesResourceURL(String url)
          Determines whether or not the specified URL has already been encoded.
static boolean isFacesResourceURL(String url)
          Determines whether or not the specified URL is a Faces URL.
 boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
           
 
Methods inherited from class javax.faces.application.ResourceHandlerWrapper
createResource, createResource, createResource, getRendererTypeForResourceName, libraryExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUFFER_SIZE

public static final int DEFAULT_BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

ResourceHandlerWrapperBase

public ResourceHandlerWrapperBase(javax.faces.application.ResourceHandler resourceHandler)
Method Detail

isEncodedFacesResourceURL

public static boolean isEncodedFacesResourceURL(String url)
Determines whether or not the specified URL has already been encoded.

Parameters:
url - The URL to check.
Returns:
True if the specified URL is already encoded.

isFacesResourceURL

public static boolean isFacesResourceURL(String url)
Determines whether or not the specified URL is a Faces URL.

Parameters:
url - The URL to check.
Returns:
True if the specified URL is a Faces URL.

handleResourceRequest

public void handleResourceRequest(javax.faces.context.FacesContext facesContext)
                           throws IOException
This method handles the current request which is assumed to be a request for a Resource.

Overrides:
handleResourceRequest in class javax.faces.application.ResourceHandlerWrapper
Throws:
IOException

handleResource

protected void handleResource(javax.faces.context.FacesContext facesContext,
                              javax.faces.application.Resource resource)
                       throws IOException
Throws:
IOException

getBufferSize

protected int getBufferSize(javax.faces.context.FacesContext facesContext)

isAbleToSetHttpStatusCode

protected boolean isAbleToSetHttpStatusCode(javax.faces.context.FacesContext facesContext)

getResourceOutputStream

protected ResourceOutputStream getResourceOutputStream(javax.faces.application.Resource resource,
                                                       int size)
This is a factory-style method that returns a ResourceOutputStream for the specified Resource. The default implementation in this class simply returns an instance of ResourceOutputStream. Subclasses that Override this method can return instances that implement the optional Filterable interface.

Parameters:
resource - The resource that is being requested.
size - The size of the buffer.
Returns:
The output stream.

isResourceRequest

public boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
Overrides:
isResourceRequest in class javax.faces.application.ResourceHandlerWrapper

getWrapped

public javax.faces.application.ResourceHandler getWrapped()
Specified by:
getWrapped in interface javax.faces.FacesWrapper<javax.faces.application.ResourceHandler>
Overrides:
getWrapped in class javax.faces.application.ResourceHandlerWrapper


Copyright © 2014 Liferay, Inc.. All Rights Reserved.