org.apache.myfaces.commons.resourcehandler
Class GZIPResourceLoader

java.lang.Object
  extended by org.apache.myfaces.commons.resourcehandler.resource.ResourceLoader
      extended by org.apache.myfaces.commons.resourcehandler.resource.ResourceLoaderWrapper
          extended by org.apache.myfaces.commons.resourcehandler.GZIPResourceLoader
All Implemented Interfaces:
javax.faces.FacesWrapper<ResourceLoader>

public class GZIPResourceLoader
extends ResourceLoaderWrapper

Author:
Leonardo Uribe, Jakob Korherr

Nested Class Summary
static class GZIPResourceLoader.FileProducer
           
 
Nested classes/interfaces inherited from class org.apache.myfaces.commons.resourcehandler.resource.ResourceLoader
ResourceLoader.VersionComparator
 
Field Summary
static String COMPRESSED_FILES_MAP
           
 
Fields inherited from class org.apache.myfaces.commons.resourcehandler.resource.ResourceLoader
VERSION_INVALID
 
Constructor Summary
GZIPResourceLoader(ResourceLoader delegate, ExtendedDefaultResourceHandlerSupport extendedDefaultResourceHandlerSupport)
           
 
Method Summary
protected  void createCompressedFileVersion(javax.faces.context.FacesContext facesContext, ResourceMeta resourceMeta, File target)
          Uses GZIPOutputStream to compress this resource.
 InputStream getResourceInputStream(ResourceMeta resourceMeta)
           
 URL getResourceURL(ResourceMeta resourceMeta)
          Return the max available version found (if exists) or return null if no version available.
 ResourceLoader getWrapped()
           
protected  void initialize()
           
 boolean resourceExists(ResourceMeta resourceMeta)
           
 
Methods inherited from class org.apache.myfaces.commons.resourcehandler.resource.ResourceLoaderWrapper
createResourceMeta, getLibraryVersion, getPrefix, getResourceVersion, getVersionComparator, libraryExists, setPrefix, setVersionComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPRESSED_FILES_MAP

public static final String COMPRESSED_FILES_MAP
See Also:
Constant Field Values
Constructor Detail

GZIPResourceLoader

public GZIPResourceLoader(ResourceLoader delegate,
                          ExtendedDefaultResourceHandlerSupport extendedDefaultResourceHandlerSupport)
Method Detail

initialize

protected void initialize()

getResourceURL

public URL getResourceURL(ResourceMeta resourceMeta)
Description copied from class: ResourceLoader
Return the max available version found (if exists) or return null if no version available.

Overrides:
getResourceURL in class ResourceLoaderWrapper

getResourceInputStream

public InputStream getResourceInputStream(ResourceMeta resourceMeta)
Overrides:
getResourceInputStream in class ResourceLoaderWrapper

resourceExists

public boolean resourceExists(ResourceMeta resourceMeta)
Overrides:
resourceExists in class ResourceLoaderWrapper

createCompressedFileVersion

protected void createCompressedFileVersion(javax.faces.context.FacesContext facesContext,
                                           ResourceMeta resourceMeta,
                                           File target)
Uses GZIPOutputStream to compress this resource. It will be stored where getCompressedFile() points to. Note that the resource really must be compressable (isCompressable() must return true).


getWrapped

public ResourceLoader getWrapped()


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.