public class MockSimpleResourceHandler
extends javax.faces.application.ResourceHandler
Mock implementation of ResourceHandler.
This Mock could be used on situations where all resources are on a specific path.
| Modifier and Type | Field and Description |
|---|---|
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
|
| Constructor and Description |
|---|
MockSimpleResourceHandler(File documentRoot) |
| Modifier and Type | Method and Description |
|---|---|
javax.faces.application.Resource |
createResource(String resourceName) |
javax.faces.application.Resource |
createResource(String resourceName,
String libraryName) |
javax.faces.application.Resource |
createResource(String resourceName,
String libraryName,
String contentType) |
protected String |
getLocalePrefixForLocateResource() |
String |
getRendererTypeForResourceName(String resourceName) |
void |
handleResourceRequest(javax.faces.context.FacesContext context) |
boolean |
isResourceRequest(javax.faces.context.FacesContext facesContext) |
boolean |
libraryExists(String libraryName) |
protected static final Pattern VERSION_CHECKER
protected static final Pattern RESOURCE_VERSION_CHECKER
public MockSimpleResourceHandler(File documentRoot)
documentRoot - parent folder of resource directories. Must not be nullpublic javax.faces.application.Resource createResource(String resourceName)
createResource in class javax.faces.application.ResourceHandlerpublic javax.faces.application.Resource createResource(String resourceName, String libraryName)
createResource in class javax.faces.application.ResourceHandlerpublic javax.faces.application.Resource createResource(String resourceName, String libraryName, String contentType)
createResource in class javax.faces.application.ResourceHandlerpublic String getRendererTypeForResourceName(String resourceName)
getRendererTypeForResourceName in class javax.faces.application.ResourceHandlerpublic void handleResourceRequest(javax.faces.context.FacesContext context)
throws IOException
handleResourceRequest in class javax.faces.application.ResourceHandlerIOExceptionpublic boolean isResourceRequest(javax.faces.context.FacesContext facesContext)
isResourceRequest in class javax.faces.application.ResourceHandlerpublic boolean libraryExists(String libraryName)
libraryExists in class javax.faces.application.ResourceHandlerprotected String getLocalePrefixForLocateResource()
Copyright © 2017 The Apache Software Foundation. All rights reserved.