Package org.omnifaces.resourcehandler
Class ResourceIdentifier
- java.lang.Object
-
- org.omnifaces.resourcehandler.ResourceIdentifier
-
public class ResourceIdentifier extends Object
Convenience class to represent a resource identifier.- Since:
- 1.3
- Author:
- Bauke Scholtz
-
-
Constructor Summary
Constructors Constructor Description ResourceIdentifier(Resource resource)
Create a new instance based on given resource.ResourceIdentifier(UIComponent componentResource)
Create a new instance based on library and name attributes of the given component resource.ResourceIdentifier(String resourceIdentifier)
Create a new instance based on given standard Faces resource identifier string formatlibrary:name
.ResourceIdentifier(String library, String name)
Create a new instance based on given resource library and name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object object)
String
getIntegrity(FacesContext context)
Returns the resource integrity as base64 encoded sha384 hash.String
getLibrary()
Returns the resource library.String
getName()
Returns the resource name.int
hashCode()
String
toString()
Returns the resource identifier as string in standard Faces resource identifier formatlibrary:name
.
-
-
-
Constructor Detail
-
ResourceIdentifier
public ResourceIdentifier(String resourceIdentifier)
Create a new instance based on given standard Faces resource identifier string formatlibrary:name
.- Parameters:
resourceIdentifier
- The standard Faces resource identifier.
-
ResourceIdentifier
public ResourceIdentifier(UIComponent componentResource)
Create a new instance based on library and name attributes of the given component resource.- Parameters:
componentResource
- The component resource.
-
ResourceIdentifier
public ResourceIdentifier(String library, String name)
Create a new instance based on given resource library and name.- Parameters:
library
- The resource lirbary.name
- The resource name.
-
ResourceIdentifier
public ResourceIdentifier(Resource resource)
Create a new instance based on given resource.- Parameters:
resource
- The resource.- Since:
- 3.13
-
-
Method Detail
-
getLibrary
public String getLibrary()
Returns the resource library.- Returns:
- The resource library.
-
getName
public String getName()
Returns the resource name.- Returns:
- The resource name.
-
getIntegrity
public String getIntegrity(FacesContext context)
Returns the resource integrity as base64 encoded sha384 hash. This is lazily computed and will return an empty string when the integrity could not be computed. The reason for the compute failure will be logged as WARNING.- Returns:
- The resource integrity as base64 encoded sha384 hash.
- Since:
- 3.13
-
-