Package org.omnifaces.resourcehandler
Class DynamicResource
- java.lang.Object
-
- jakarta.faces.application.ViewResource
-
- jakarta.faces.application.Resource
-
- org.omnifaces.resourcehandler.DynamicResource
-
- Direct Known Subclasses:
CombinedResource
,GraphicResource
public abstract class DynamicResource extends Resource
ThisResource
implementation represents a cacheable dynamic resource which doesn't necessarily exist as a regular classpath resource.- Since:
- 2.0
- Author:
- Bauke Scholtz
-
-
Field Summary
-
Fields inherited from class jakarta.faces.application.Resource
COMPONENT_RESOURCE_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DynamicResource(String resourceName, String libraryName, String contentType)
Constructs a new dynamic resource based on the given resource name, library name and content type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLastModified()
Returns the "last modified" timestamp of this resource.String
getRequestPath()
Map<String,String>
getResponseHeaders()
URL
getURL()
void
setLastModified(long lastModified)
Sets the "last modified" timestamp of this resource.boolean
userAgentNeedsUpdate(FacesContext context)
-
Methods inherited from class jakarta.faces.application.Resource
getContentType, getInputStream, getLibraryName, getResourceName, setContentType, setLibraryName, setResourceName, toString
-
-
-
-
Constructor Detail
-
DynamicResource
protected DynamicResource(String resourceName, String libraryName, String contentType)
Constructs a new dynamic resource based on the given resource name, library name and content type.- Parameters:
resourceName
- The resource name.libraryName
- The library name.contentType
- The content type.
-
-
Method Detail
-
getRequestPath
public String getRequestPath()
- Specified by:
getRequestPath
in classResource
-
getResponseHeaders
public Map<String,String> getResponseHeaders()
- Specified by:
getResponseHeaders
in classResource
-
getLastModified
public long getLastModified()
Returns the "last modified" timestamp of this resource.- Returns:
- The "last modified" timestamp of this resource.
-
setLastModified
public void setLastModified(long lastModified)
Sets the "last modified" timestamp of this resource.- Parameters:
lastModified
- The "last modified" timestamp of this resource.
-
userAgentNeedsUpdate
public boolean userAgentNeedsUpdate(FacesContext context)
- Specified by:
userAgentNeedsUpdate
in classResource
-
-