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_CONTRACT_XML, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER, WEBAPP_CONTRACTS_DIRECTORY_PARAM_NAME, WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME
 
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)
           
protected  boolean isAbleToSetHttpStatusCode(javax.faces.context.FacesContext facesContext)
           
 
Methods inherited from class javax.faces.application.ResourceHandlerWrapper
createResource, createResource, createResource, createResourceFromId, createViewResource, getRendererTypeForResourceName, handleResourceRequest, isResourceRequest, isResourceURL, 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

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.

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 © 2015 Liferay, Inc.. All rights reserved.