org.apache.myfaces.custom.stylesheet
Class TextResourceFilterProvider

java.lang.Object
  extended by org.apache.myfaces.custom.stylesheet.TextResourceFilterProvider
All Implemented Interfaces:
ResourceProvider

public class TextResourceFilterProvider
extends Object
implements ResourceProvider

Allow URLs to return data that is cached by the TextResourceFilter class.

This implements the Tomahawk ResourceProvider interface which works together with the Tomahawk AddResourceFactory, ExtensionsFilter and AddResource classes. The AddResourceFactory can generate a URL which can be embedded in an HTML page. When invoked, that URL triggers the ExtensionsFilter which invokes AddResource which then calls back into this class. And this class then retrieves the requested data from the TextResourceFilter.


Constructor Summary
TextResourceFilterProvider()
           
 
Method Summary
 boolean exists(javax.servlet.ServletContext context, String resource)
          check if the resource exists
 int getContentLength(javax.servlet.ServletContext context, String resource)
          get the content length of the resource
 String getEncoding(javax.servlet.ServletContext context, String resource)
          get resource encoding
 InputStream getInputStream(javax.servlet.ServletContext context, String resource)
          get the input stream of the resource
 long getLastModified(javax.servlet.ServletContext context, String resource)
          get the last modified time of the resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextResourceFilterProvider

public TextResourceFilterProvider()
Method Detail

exists

public boolean exists(javax.servlet.ServletContext context,
                      String resource)
Description copied from interface: ResourceProvider
check if the resource exists

Specified by:
exists in interface ResourceProvider

getContentLength

public int getContentLength(javax.servlet.ServletContext context,
                            String resource)
                     throws IOException
Description copied from interface: ResourceProvider
get the content length of the resource

Specified by:
getContentLength in interface ResourceProvider
Throws:
IOException

getLastModified

public long getLastModified(javax.servlet.ServletContext context,
                            String resource)
                     throws IOException
Description copied from interface: ResourceProvider
get the last modified time of the resource

Specified by:
getLastModified in interface ResourceProvider
Throws:
IOException

getInputStream

public InputStream getInputStream(javax.servlet.ServletContext context,
                                  String resource)
                           throws IOException
Description copied from interface: ResourceProvider
get the input stream of the resource

Specified by:
getInputStream in interface ResourceProvider
Throws:
IOException

getEncoding

public String getEncoding(javax.servlet.ServletContext context,
                          String resource)
                   throws IOException
Description copied from interface: ResourceProvider
get resource encoding

Specified by:
getEncoding in interface ResourceProvider
Throws:
IOException


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.