Package org.apache.myfaces.resource
Class InternalClassLoaderResourceLoader
- java.lang.Object
-
- org.apache.myfaces.resource.ResourceLoader
-
- org.apache.myfaces.resource.InternalClassLoaderResourceLoader
-
public class InternalClassLoaderResourceLoader extends ResourceLoader
A resource loader implementation which loads resources from the thread ClassLoader.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.myfaces.resource.ResourceLoader
ResourceLoader.VersionComparator
-
-
Field Summary
-
Fields inherited from class org.apache.myfaces.resource.ResourceLoader
VERSION_INVALID
-
-
Constructor Summary
Constructors Constructor Description InternalClassLoaderResourceLoader(String prefix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceMeta
createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)
protected ClassLoader
getClassLoader()
Returns the ClassLoader to use when looking up resources under the top level package.String
getLibraryVersion(String path)
Return the max available version found (if exists) or return null if no version available.InputStream
getResourceInputStream(ResourceMeta resourceMeta)
URL
getResourceURL(String resourceId)
URL
getResourceURL(ResourceMeta resourceMeta)
Return the max available version found (if exists) or return null if no version available.String
getResourceVersion(String path)
Iterator<String>
iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
boolean
libraryExists(String libraryName)
-
Methods inherited from class org.apache.myfaces.resource.ResourceLoader
createResourceMeta, getPrefix, getVersionComparator, resourceExists, setPrefix, setVersionComparator
-
-
-
-
Constructor Detail
-
InternalClassLoaderResourceLoader
public InternalClassLoaderResourceLoader(String prefix)
-
-
Method Detail
-
getLibraryVersion
public String getLibraryVersion(String path)
Description copied from class:ResourceLoader
Return the max available version found (if exists) or return null if no version available.- Specified by:
getLibraryVersion
in classResourceLoader
-
getResourceInputStream
public InputStream getResourceInputStream(ResourceMeta resourceMeta)
- Specified by:
getResourceInputStream
in classResourceLoader
-
getResourceURL
public URL getResourceURL(ResourceMeta resourceMeta)
Description copied from class:ResourceLoader
Return the max available version found (if exists) or return null if no version available.- Specified by:
getResourceURL
in classResourceLoader
-
getResourceVersion
public String getResourceVersion(String path)
- Specified by:
getResourceVersion
in classResourceLoader
-
createResourceMeta
public ResourceMeta createResourceMeta(String prefix, String libraryName, String libraryVersion, String resourceName, String resourceVersion)
- Specified by:
createResourceMeta
in classResourceLoader
-
getClassLoader
protected ClassLoader getClassLoader()
Returns the ClassLoader to use when looking up resources under the top level package. By default, this is the context class loader.- Returns:
- the ClassLoader used to lookup resources
-
libraryExists
public boolean libraryExists(String libraryName)
- Specified by:
libraryExists
in classResourceLoader
-
iterator
public Iterator<String> iterator(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
- Overrides:
iterator
in classResourceLoader
-
-