- java.lang.Object
-
- jakarta.faces.application.ResourceHandler
-
- jakarta.faces.application.ResourceHandlerWrapper
-
- org.omnifaces.resourcehandler.DefaultResourceHandler
-
- org.omnifaces.resourcehandler.GraphicResourceHandler
-
- All Implemented Interfaces:
FacesWrapper<ResourceHandler>
public class GraphicResourceHandler extends DefaultResourceHandler
This
ResourceHandler
implementation deals withGraphicResource
requests.- Since:
- 2.0
- Author:
- Bauke Scholtz
-
-
Field Summary
Fields Modifier and Type Field Description static String
LIBRARY_NAME
The default library name of a graphic resource.-
Fields inherited from class org.omnifaces.resourcehandler.DefaultResourceHandler
FACES_SCRIPT_RESOURCE_NAME, RES_NOT_FOUND
-
Fields inherited from class jakarta.faces.application.ResourceHandler
JSF_SCRIPT_LIBRARY_NAME, JSF_SCRIPT_RESOURCE_NAME, LOCALE_PREFIX, RESOURCE_CONTRACT_XML, RESOURCE_EXCLUDES_DEFAULT_VALUE, RESOURCE_EXCLUDES_PARAM_NAME, RESOURCE_IDENTIFIER, WEBAPP_CONTRACTS_DIRECTORY_PARAM_NAME, WEBAPP_RESOURCES_DIRECTORY_PARAM_NAME
-
-
Constructor Summary
Constructors Constructor Description GraphicResourceHandler(ResourceHandler wrapped)
Creates a new instance of this graphic resource handler which wraps the given resource handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Resource
createResourceFromLibrary(String resourceName, String contentType)
Returns a newGraphicResource
.String
getLibraryName()
ReturnsLIBRARY_NAME
.-
Methods inherited from class org.omnifaces.resourcehandler.DefaultResourceHandler
createResource, createResource, createResource, decorateResource, decorateResource
-
Methods inherited from class jakarta.faces.application.ResourceHandlerWrapper
createResourceFromId, createViewResource, getRendererTypeForResourceName, getViewResources, getViewResources, getWrapped, handleResourceRequest, isResourceRendered, isResourceRequest, isResourceURL, libraryExists, markResourceRendered
-
-
-
-
Field Detail
-
LIBRARY_NAME
public static final String LIBRARY_NAME
The default library name of a graphic resource. Make sure that this is never used for other libraries.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GraphicResourceHandler
public GraphicResourceHandler(ResourceHandler wrapped)
Creates a new instance of this graphic resource handler which wraps the given resource handler.- Parameters:
wrapped
- The resource handler to be wrapped.
-
-
Method Detail
-
getLibraryName
public String getLibraryName()
ReturnsLIBRARY_NAME
.- Overrides:
getLibraryName
in classDefaultResourceHandler
- Returns:
- The library name on which this resource handler implementation should listen.
-
createResourceFromLibrary
public Resource createResourceFromLibrary(String resourceName, String contentType)
Returns a newGraphicResource
.- Overrides:
createResourceFromLibrary
in classDefaultResourceHandler
- Parameters:
resourceName
- The resource name.contentType
- The content type.- Returns:
- The library-specific resource.
-
-