org.apache.myfaces.commons.resourcehandler.resource
Class ResourceLoader

java.lang.Object
  extended by org.apache.myfaces.commons.resourcehandler.resource.ResourceLoader
Direct Known Subclasses:
ClassLoaderResourceLoader, ExternalContextResourceLoader, ResourceLoaderWrapper

public abstract class ResourceLoader
extends Object

Base class for resource loaders. Resource loaders can lookup resources as URLs from arbitrary locations, including JAR files.

Version:
$Revision: 882702 $ $Date: 2009-11-20 15:16:07 -0500 (Vie, 20 Nov 2009) $
Author:
Leonardo Uribe (latest modification by $Author: lu4242 $)

Nested Class Summary
 class ResourceLoader.VersionComparator
           
 
Field Summary
static String VERSION_INVALID
           
 
Constructor Summary
ResourceLoader(String prefix)
           
 
Method Summary
abstract  ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)
           
abstract  String getLibraryVersion(String path)
          Return the max available version found (if exists) or return null if no version available.
 String getPrefix()
           
abstract  InputStream getResourceInputStream(ResourceMeta resourceMeta)
           
abstract  URL getResourceURL(ResourceMeta resourceMeta)
          Return the max available version found (if exists) or return null if no version available.
abstract  String getResourceVersion(String path)
           
protected  Comparator<String> getVersionComparator()
           
abstract  boolean libraryExists(String libraryName)
           
 boolean resourceExists(ResourceMeta resourceMeta)
           
 void setPrefix(String prefix)
           
protected  void setVersionComparator(Comparator<String> versionComparator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_INVALID

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

ResourceLoader

public ResourceLoader(String prefix)
Method Detail

getResourceVersion

public abstract String getResourceVersion(String path)

getLibraryVersion

public abstract String getLibraryVersion(String path)
Return the max available version found (if exists) or return null if no version available.


getResourceURL

public abstract URL getResourceURL(ResourceMeta resourceMeta)
Return the max available version found (if exists) or return null if no version available.


getResourceInputStream

public abstract InputStream getResourceInputStream(ResourceMeta resourceMeta)

createResourceMeta

public abstract ResourceMeta createResourceMeta(String prefix,
                                                String libraryName,
                                                String libraryVersion,
                                                String resourceName,
                                                String resourceVersion)

libraryExists

public abstract boolean libraryExists(String libraryName)

resourceExists

public boolean resourceExists(ResourceMeta resourceMeta)

getVersionComparator

protected Comparator<String> getVersionComparator()

setVersionComparator

protected void setVersionComparator(Comparator<String> versionComparator)

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)


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