org.apache.myfaces.resource
Class ExternalContextContractResourceLoader

java.lang.Object
  extended by org.apache.myfaces.shared.resource.ResourceLoader
      extended by org.apache.myfaces.shared.resource.ContractResourceLoader
          extended by org.apache.myfaces.resource.ExternalContextContractResourceLoader

public class ExternalContextContractResourceLoader
extends ContractResourceLoader

Author:
lu4242

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.myfaces.shared.resource.ResourceLoader
ResourceLoader.VersionComparator
 
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
 
Fields inherited from class org.apache.myfaces.shared.resource.ContractResourceLoader
VERSION_INVALID
 
Constructor Summary
ExternalContextContractResourceLoader(String prefix)
           
 
Method Summary
 ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)
           
 String getLibraryVersion(String path, String contractName)
           
 InputStream getResourceInputStream(ResourceMeta resourceMeta)
           
protected  Set<String> getResourcePaths(String contractName, String path)
           
 URL getResourceURL(ResourceMeta resourceMeta)
           
 String getResourceVersion(String path, String contractName)
           
 boolean libraryExists(String libraryName, String contractName)
           
 
Methods inherited from class org.apache.myfaces.shared.resource.ContractResourceLoader
createResourceMeta, getLibraryVersion, getResourceVersion, libraryExists
 
Methods inherited from class org.apache.myfaces.shared.resource.ResourceLoader
getPrefix, getVersionComparator, resourceExists, setPrefix, setVersionComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getResourcePaths

protected Set<String> getResourcePaths(String contractName,
                                       String path)

getResourceVersion

public String getResourceVersion(String path,
                                 String contractName)
Specified by:
getResourceVersion in class ContractResourceLoader

getLibraryVersion

public String getLibraryVersion(String path,
                                String contractName)
Specified by:
getLibraryVersion in class ContractResourceLoader

getResourceURL

public URL getResourceURL(ResourceMeta resourceMeta)
Specified by:
getResourceURL in class ResourceLoader

getResourceInputStream

public InputStream getResourceInputStream(ResourceMeta resourceMeta)
Specified by:
getResourceInputStream in class ResourceLoader

createResourceMeta

public ResourceMeta createResourceMeta(String prefix,
                                       String libraryName,
                                       String libraryVersion,
                                       String resourceName,
                                       String resourceVersion,
                                       String contractName)
Specified by:
createResourceMeta in class ContractResourceLoader

libraryExists

public boolean libraryExists(String libraryName,
                             String contractName)
Specified by:
libraryExists in class ContractResourceLoader


Copyright © 2014 The Apache Software Foundation. All rights reserved.