org.apache.myfaces.trinidad.resource
Class AggregatingResourceLoader

java.lang.Object
  extended by org.apache.myfaces.trinidad.resource.ResourceLoader
      extended by org.apache.myfaces.trinidad.resource.DynamicResourceLoader
          extended by org.apache.myfaces.trinidad.resource.AggregatingResourceLoader

public class AggregatingResourceLoader
extends DynamicResourceLoader

A resource loader implementation which combines multiple resources into a single stream. This version leverages the DynamicResourceLoader.


Nested Class Summary
 class AggregatingResourceLoader.AggregatingURLStreamHandler
          This is a Stream Handler which can be used to construct a URL that is an Aggregate of a list of other urls.
 
Constructor Summary
AggregatingResourceLoader(String path, String[] paths, ResourceLoader target)
          Creates a new AggregatingResourceLoader.
AggregatingResourceLoader(String path, String[] paths, ResourceLoader target, ResourceLoader parent)
          Creates a new AggregatingResourceLoader.
 
Method Summary
protected  URL getURL(String path)
          Returns a URL which is an aggregate of all the paths.
 void setSeparator(String separator)
          Sets the separator to use in between streams.
 
Methods inherited from class org.apache.myfaces.trinidad.resource.DynamicResourceLoader
findResource
 
Methods inherited from class org.apache.myfaces.trinidad.resource.ResourceLoader
getContentType, getContentType, getNullResourceLoader, getParent, getResource, isCachable, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregatingResourceLoader

public AggregatingResourceLoader(String path,
                                 String[] paths,
                                 ResourceLoader target,
                                 ResourceLoader parent)
Creates a new AggregatingResourceLoader.

Parameters:
path - the aggregated resource path
paths - the target resource paths to aggregate
target - the resource loader use to find target resource paths
parent - the parent resource loader

AggregatingResourceLoader

public AggregatingResourceLoader(String path,
                                 String[] paths,
                                 ResourceLoader target)
Creates a new AggregatingResourceLoader.

Parameters:
path - the aggregated resource path
paths - the target resource paths to aggregate
target - the resource loader use to find target resource paths
Method Detail

setSeparator

public void setSeparator(String separator)
Sets the separator to use in between streams. This will typically contain a newline character. By default the value is null which implies no separator.

Parameters:
separator - a string containing the separator characters

getURL

protected URL getURL(String path)
              throws IOException
Returns a URL which is an aggregate of all the paths.

Specified by:
getURL in class DynamicResourceLoader
Parameters:
path - the current path
Returns:
a aggregate url
Throws:
IOException - when something bad happens


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