org.apache.myfaces.shared.resource
Class ResourceLoader

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

public abstract class ResourceLoader
extends java.lang.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 java.lang.String VERSION_INVALID
           
 
Constructor Summary
ResourceLoader(java.lang.String prefix)
           
 
Method Summary
abstract  ResourceMeta createResourceMeta(java.lang.String prefix, java.lang.String libraryName, java.lang.String libraryVersion, java.lang.String resourceName, java.lang.String resourceVersion)
           
abstract  java.lang.String getLibraryVersion(java.lang.String path)
          Return the max available version found (if exists) or return null if no version available.
 java.lang.String getPrefix()
           
abstract  java.io.InputStream getResourceInputStream(ResourceMeta resourceMeta)
           
abstract  java.net.URL getResourceURL(ResourceMeta resourceMeta)
          Return the max available version found (if exists) or return null if no version available.
abstract  java.lang.String getResourceVersion(java.lang.String path)
           
protected  java.util.Comparator<java.lang.String> getVersionComparator()
           
abstract  boolean libraryExists(java.lang.String libraryName)
           
 void setPrefix(java.lang.String prefix)
           
protected  void setVersionComparator(java.util.Comparator<java.lang.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 java.lang.String VERSION_INVALID
See Also:
Constant Field Values
Constructor Detail

ResourceLoader

public ResourceLoader(java.lang.String prefix)
Method Detail

getResourceVersion

public abstract java.lang.String getResourceVersion(java.lang.String path)

getLibraryVersion

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


getResourceURL

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


getResourceInputStream

public abstract java.io.InputStream getResourceInputStream(ResourceMeta resourceMeta)

createResourceMeta

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

libraryExists

public abstract boolean libraryExists(java.lang.String libraryName)

getVersionComparator

protected java.util.Comparator<java.lang.String> getVersionComparator()

setVersionComparator

protected void setVersionComparator(java.util.Comparator<java.lang.String> versionComparator)

getPrefix

public java.lang.String getPrefix()

setPrefix

public void setPrefix(java.lang.String prefix)


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