Package org.apache.myfaces.resource
Class ResourceLoader
- java.lang.Object
-
- org.apache.myfaces.resource.ResourceLoader
-
- Direct Known Subclasses:
ClassLoaderResourceLoader
,ContractResourceLoader
,ExternalContextResourceLoader
,InternalClassLoaderResourceLoader
,ResourceLoaderWrapper
,RootExternalContextResourceLoader
public abstract class ResourceLoader extends Object
Base class for resource loaders. Resource loaders can lookup resources as URLs from arbitrary locations, including JAR files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResourceLoader.VersionComparator
-
Field Summary
Fields Modifier and Type Field Description static String
VERSION_INVALID
-
Constructor Summary
Constructors Constructor Description ResourceLoader(String prefix)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ResourceMeta
createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)
ResourceMeta
createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)
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(ResourceMeta resourceMeta)
abstract URL
getResourceURL(ResourceMeta 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()
Iterator<String>
iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
abstract boolean
libraryExists(String libraryName)
boolean
resourceExists(ResourceMeta resourceMeta)
void
setPrefix(String prefix)
protected void
setVersionComparator(Comparator<String> versionComparator)
-
-
-
Field Detail
-
VERSION_INVALID
public static final String VERSION_INVALID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResourceLoader
public ResourceLoader(String prefix)
-
-
Method Detail
-
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(ResourceMeta resourceMeta)
Return the max available version found (if exists) or return null if no version available.
-
getResourceInputStream
public abstract InputStream getResourceInputStream(ResourceMeta resourceMeta)
-
createResourceMeta
public abstract ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)
-
createResourceMeta
public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)
-
libraryExists
public abstract boolean libraryExists(String libraryName)
-
resourceExists
public boolean resourceExists(ResourceMeta resourceMeta)
-
iterator
public Iterator<String> iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
-
getVersionComparator
protected Comparator<String> getVersionComparator()
-
setVersionComparator
protected void setVersionComparator(Comparator<String> versionComparator)
-
getPrefix
public String getPrefix()
-
setPrefix
public void setPrefix(String prefix)
-
-