org.apache.myfaces.test.mock.resource
Class MockExternalContextResourceLoader
java.lang.Object
org.apache.myfaces.test.mock.resource.MockResourceLoader
org.apache.myfaces.test.mock.resource.MockExternalContextResourceLoader
public class MockExternalContextResourceLoader
- extends MockResourceLoader
A resource loader implementation which loads resources from the webapp root.
It uses the methods on ExternalContext for handle resources.
- 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 $)
Field Summary |
protected static Pattern |
RESOURCE_VERSION_CHECKER
It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
Used on getResourceVersion to filter resources |
protected static Pattern |
VERSION_CHECKER
It checks version like this: /1/, /1_0/, /1_0_0/, /100_100/
Used on getLibraryVersion to filter resource directories |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VERSION_CHECKER
protected static Pattern VERSION_CHECKER
- It checks version like this: /1/, /1_0/, /1_0_0/, /100_100/
Used on getLibraryVersion to filter resource directories
RESOURCE_VERSION_CHECKER
protected static Pattern RESOURCE_VERSION_CHECKER
- It checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js
Used on getResourceVersion to filter resources
MockExternalContextResourceLoader
public MockExternalContextResourceLoader(String prefix)
getResourcePaths
protected Set<String> getResourcePaths(String path)
getResourceVersion
public String getResourceVersion(String path)
- Specified by:
getResourceVersion
in class MockResourceLoader
getLibraryVersion
public String getLibraryVersion(String path)
- Description copied from class:
MockResourceLoader
- Return the max available version found (if exists) or
return null if no version available.
- Specified by:
getLibraryVersion
in class MockResourceLoader
getResourceURL
public URL getResourceURL(MockResourceMeta resourceMeta)
- Description copied from class:
MockResourceLoader
- Return the max available version found (if exists) or
return null if no version available.
- Specified by:
getResourceURL
in class MockResourceLoader
getResourceInputStream
public InputStream getResourceInputStream(MockResourceMeta resourceMeta)
- Specified by:
getResourceInputStream
in class MockResourceLoader
createResourceMeta
public MockResourceMeta createResourceMeta(String prefix,
String libraryName,
String libraryVersion,
String resourceName,
String resourceVersion)
- Specified by:
createResourceMeta
in class MockResourceLoader
libraryExists
public boolean libraryExists(String libraryName)
- Specified by:
libraryExists
in class MockResourceLoader
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.