Package org.apache.myfaces.resource
Class ExternalContextContractResourceLoader
- java.lang.Object
-
- org.apache.myfaces.resource.ResourceLoader
-
- org.apache.myfaces.resource.ContractResourceLoader
-
- org.apache.myfaces.resource.ExternalContextContractResourceLoader
-
public class ExternalContextContractResourceLoader extends ContractResourceLoader
- Author:
- lu4242
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.myfaces.resource.ResourceLoader
ResourceLoader.VersionComparator
-
-
Field Summary
Fields Modifier and Type Field Description protected static PatternRESOURCE_VERSION_CHECKERIt checks version like this: /1.js, /1_0.js, /1_0_0.js, /100_100.js Used on getResourceVersion to filter resourcesprotected static PatternVERSION_CHECKERIt checks version like this: /1/, /1_0/, /1_0_0/, /100_100/ Used on getLibraryVersion to filter resource directories-
Fields inherited from class org.apache.myfaces.resource.ContractResourceLoader
VERSION_INVALID
-
-
Constructor Summary
Constructors Constructor Description ExternalContextContractResourceLoader(String prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceMetacreateResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)StringgetLibraryVersion(String path, String contractName)Return the max available version found (if exists) or return null if no version available.InputStreamgetResourceInputStream(ResourceMeta resourceMeta)protected Set<String>getResourcePaths(String contractName, String path)URLgetResourceURL(ResourceMeta resourceMeta)Return the max available version found (if exists) or return null if no version available.StringgetResourceVersion(String path, String contractName)Iterator<String>iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)booleanlibraryExists(String libraryName, String contractName)-
Methods inherited from class org.apache.myfaces.resource.ContractResourceLoader
createResourceMeta, getLibraryVersion, getResourceVersion, libraryExists
-
Methods inherited from class org.apache.myfaces.resource.ResourceLoader
getPrefix, getVersionComparator, resourceExists, setPrefix, setVersionComparator
-
-
-
-
Field Detail
-
VERSION_CHECKER
protected static final 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 final 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
-
-
Constructor Detail
-
ExternalContextContractResourceLoader
public ExternalContextContractResourceLoader(String prefix)
-
-
Method Detail
-
getResourceVersion
public String getResourceVersion(String path, String contractName)
- Specified by:
getResourceVersionin classContractResourceLoader
-
getLibraryVersion
public String getLibraryVersion(String path, String contractName)
Description copied from class:ContractResourceLoaderReturn the max available version found (if exists) or return null if no version available.- Specified by:
getLibraryVersionin classContractResourceLoader
-
getResourceURL
public URL getResourceURL(ResourceMeta resourceMeta)
Description copied from class:ResourceLoaderReturn the max available version found (if exists) or return null if no version available.- Specified by:
getResourceURLin classResourceLoader
-
getResourceInputStream
public InputStream getResourceInputStream(ResourceMeta resourceMeta)
- Specified by:
getResourceInputStreamin classResourceLoader
-
createResourceMeta
public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)
- Specified by:
createResourceMetain classContractResourceLoader
-
libraryExists
public boolean libraryExists(String libraryName, String contractName)
- Specified by:
libraryExistsin classContractResourceLoader
-
iterator
public Iterator<String> iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
- Overrides:
iteratorin classResourceLoader
-
-