org.apache.myfaces.test.mock.resource
Class MockResourceLoader

java.lang.Object
  extended by org.apache.myfaces.test.mock.resource.MockResourceLoader
Direct Known Subclasses:
MockClassLoaderResourceLoader, MockExternalContextResourceLoader

public abstract class MockResourceLoader
extends Object

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

Since:
1.0.0
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 MockResourceLoader.VersionComparator
           
 
Field Summary
static String VERSION_INVALID
           
 
Constructor Summary
MockResourceLoader(String prefix)
           
 
Method Summary
abstract  MockResourceMeta 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(MockResourceMeta resourceMeta)
           
abstract  URL getResourceURL(MockResourceMeta 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)
           
 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

MockResourceLoader

public MockResourceLoader(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(MockResourceMeta resourceMeta)
Return the max available version found (if exists) or return null if no version available.


getResourceInputStream

public abstract InputStream getResourceInputStream(MockResourceMeta resourceMeta)

createResourceMeta

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

libraryExists

public abstract boolean libraryExists(String libraryName)

getVersionComparator

protected Comparator<String> getVersionComparator()

setVersionComparator

protected void setVersionComparator(Comparator<String> versionComparator)

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)


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