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 classResourceLoader.VersionComparator
-
Field Summary
Fields Modifier and Type Field Description static StringVERSION_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 ResourceMetacreateResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)ResourceMetacreateResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion, String contractName)abstract StringgetLibraryVersion(String path)Return the max available version found (if exists) or return null if no version available.StringgetPrefix()abstract InputStreamgetResourceInputStream(ResourceMeta resourceMeta)abstract URLgetResourceURL(ResourceMeta resourceMeta)Return the max available version found (if exists) or return null if no version available.abstract StringgetResourceVersion(String path)protected Comparator<String>getVersionComparator()Iterator<String>iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)abstract booleanlibraryExists(String libraryName)booleanresourceExists(ResourceMeta resourceMeta)voidsetPrefix(String prefix)protected voidsetVersionComparator(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)
-
-