ResourceHandler.
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| pack-priv List | |
| private static final Logger | |
| pack-priv ResourceManager | |
| private long | |
| private WebConfiguration |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private ByteBuffer | |
| public Resource | createResource(String
the name of the resource. resourceName)Implements abstract javax.
Create an instance of |
| public Resource | createResource(String
the name of the resource. resourceName, String the name of the library (or
contract) in which this resource resides, may be libraryName)null. If there is a
conflict between the name of a resource library and a resource library contract,
the resource library takes precedence.
May not include relative paths, such as
"../".Implements abstract javax.
Create an instance of |
| public Resource | createResource(String
the name of the resource. resourceName, String the name of the library in which this resource resides, may be
libraryName, String null. May not include
relative paths, such as "../".the mime content that this contentType)Resource instance will return from
Resource#getContentType. If the value is null, The
content-type of the resource is derived by passing the resourceName to
javax.faces.context.ExternalContext#getMimeTypeImplements abstract javax.
Create an instance of |
| public Resource | createResourceFromId(String
the resource identifier of the resource. resourceId)Overrides javax.
Create an instance of |
| public Resource | createViewResource(FacesContext
the facesContext, String FacesContext for this request.the name of the resource to be interpreted as a view by the
resourceName)javax.faces.view.ViewDeclarationLanguage.Overrides javax.
Create an instance of |
| private String | Returns: the content type for this resourcethe resource of interest. The resourceName in question
may consist of zero or more path elements such that resourceName could
be something like path1/path2/resource.jpg or resource.jpg resourceName)
|
| pack-priv long | Returns: the time when the ResourceHandler was instantiated (in milliseconds)This method is leveraged by |
| public String | getRendererTypeForResourceName(String
the resource name. resourceName)Implements abstract javax.
Return the |
| public Stream | getViewResources(FacesContext
The facesContext, String FacesContext for this request.The initial path from which to start looking for view resources path, ResourceVisitOption... The options to influence the traversal. See options)ResourceVisitOption for
details on those.Overrides javax.
Return a |
| public Stream | getViewResources(FacesContext
The facesContext, String FacesContext for this request.The initial path from which to start looking for view resources path, int The absolute maximum depth of nested directories to visit counted from the
root ( maxDepth, ResourceVisitOption... /).The options to influence the traversal. See options)ResourceVisitOption for
details on those.Overrides javax.
Return a |
| pack-priv WebConfiguration | Returns: theWebConfiguration for this applicationUtility method leveraged by ResourceImpl to reduce the cost of looking up the WebConfiguration per-instance. |
| private void | |
| public void | handleResourceRequest(FacesContext
the context)javax.faces.context.FacesContext for this requestImplements abstract javax. This method specifies the contract for satisfying resource requests. |
| private void | |
| private void | |
| private boolean | Returns: true if the request matces an excluded resource,
otherwise falsethe normalized request path as returned by
resourceId)normalizeResourceRequest(javax.faces.context.FacesContext)
|
| public boolean | isResourceRequest(FacesContext
the context)javax.faces.context.FacesContext for this requestImplements abstract javax.
Return |
| public boolean | libraryExists(String
the library name. libraryName)Implements abstract javax.
Return |
| private boolean | |
| private void | logMissingResource(FacesContext
the ctx, String FacesContext for the current requestthe resource name resourceName, String the resource library libraryName, Throwable the exception caught when attempting to find the resource t)Log a message indicating a particular resource (reference by name and/or library) could not be found. |
| private void | logMissingResource(FacesContext
the ctx, String FacesContext for the current requestthe resource name resourceId, Throwable the exception caught when attempting to find the resource t)Log a message indicating a particular resource (reference by name and/or library) could not be found. |
| private String | Returns: the request path without JSF invocation informationthe context)FacesContext for the current requestNormalize the request path to exclude JSF invocation information. |
| private void | |
| private void | |
| private void | |
| pack-priv void | setCreationTime(long
the time in milliseconds creationTime)This method is here soley for the purpose of unit testing and will not be invoked during normal runtime. |
| creationTime | back to summary |
|---|---|
| private long creationTime | |
| excludePatterns | back to summary |
|---|---|
| pack-priv List<Pattern> excludePatterns | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| manager | back to summary |
|---|---|
| pack-priv ResourceManager manager | |
| maxAge | back to summary |
|---|---|
| private long maxAge | |
| webconfig | back to summary |
|---|---|
| private WebConfiguration webconfig | |
| ResourceHandlerImpl | back to summary |
|---|---|
| public ResourceHandlerImpl() Creates a new instance of ResourceHandlerImpl | |
| allocateByteBuffer | back to summary |
|---|---|
| private ByteBuffer allocateByteBuffer() | |
| createResource | back to summary |
|---|---|
| public Resource createResource(String resourceName) Implements abstract javax. Doc from javax.
Create an instance of
The algorithm specified in section JSF.2.6.1.4 of the spec prose document
linked in the overview summary
must be executed to create the
| |
| createResource | back to summary |
|---|---|
| public Resource createResource(String resourceName, String libraryName) Implements abstract javax. Doc from javax.
Create an instance of
The algorithm specified in section JSF.2.6.1.4 of the spec prose document
linked in the overview summary
must be executed to create the
| |
| createResource | back to summary |
|---|---|
| public Resource createResource(String resourceName, String libraryName, String contentType) Implements abstract javax. Doc from javax.
Create an instance of
The algorithm specified in section JSF.2.6.1.4 of the spec prose document
linked in the overview summary
must be executed to create the
| |
| createResourceFromId | back to summary |
|---|---|
| public Resource createResourceFromId(String resourceId) Overrides javax. Doc from javax.
Create an instance of The resource must be identified according to the specification in JSF.2.6.1.3 of the spec prose document linked in the overview summary. New requirements were introduced in version 2.2 of the specification.
| |
| createViewResource | back to summary |
|---|---|
| public Resource createViewResource(FacesContext facesContext, String resourceName) Overrides javax. Doc from javax.
Create an instance of The default implementation must look for the resource in the following places, in this order.
Call
| |
| getContentType | back to summary |
|---|---|
| private String getContentType(FacesContext ctx, String resourceName) | |
| getCreationTime | back to summary |
|---|---|
| pack-priv long getCreationTime() This method is leveraged by
| |
| getRendererTypeForResourceName | back to summary | ||||||
|---|---|---|---|---|---|---|---|
| public String getRendererTypeForResourceName(String resourceName) Implements abstract javax. Doc from javax.
Return the
| |||||||
| getViewResources | back to summary |
|---|---|
| public Stream Overrides javax. Doc from javax.
Return a This method works as if invoking it were equivalent to evaluating the expression: Put differently, it visits all levels of the resource tree.getViewResources(facesContext, start, Integer.MAX_VALUE, options)
| |
| getViewResources | back to summary |
|---|---|
| public Stream Overrides javax. Doc from javax.
Return a
The
| |
| getWebConfig | back to summary |
|---|---|
| pack-priv WebConfiguration getWebConfig() Utility method leveraged by ResourceImpl to reduce the cost of looking up the WebConfiguration per-instance.
| |
| handleHeaders | back to summary |
|---|---|
| private void handleHeaders(FacesContext ctx, Resource resource) | |
| handleResourceRequest | back to summary |
|---|---|
| public void handleResourceRequest(FacesContext context) throws IOException Implements abstract javax. Doc from javax.
This method specifies the contract for satisfying resource requests. This method is called
from The default implementation must implement an algorithm semantically identical to the following algorithm. For discussion, in all cases when a status code is to be set, this spec talks only using the Servlet API, but it is understood that in a portlet environment the appropriate equivalent API must be used.
| |
| initExclusions | back to summary |
|---|---|
| private void initExclusions(Map<String, Object> appMap) Initialize the exclusions for this application. If no explicit exclusions are configured, the defaults of
| |
| initMaxAge | back to summary |
|---|---|
| private void initMaxAge() | |
| isExcluded | back to summary |
|---|---|
private boolean isExcluded(String resourceId)
| |
| isResourceRequest | back to summary |
|---|---|
| public boolean isResourceRequest(FacesContext context) Implements abstract javax. Doc from javax.
Return
| |
| libraryExists | back to summary |
|---|---|
| public boolean libraryExists(String libraryName) Implements abstract javax. Doc from javax.
Return | |
| libraryNameIsSafe | back to summary |
|---|---|
| private boolean libraryNameIsSafe(String libraryName) | |
| logMissingResource | back to summary |
|---|---|
| private void logMissingResource(FacesContext ctx, String resourceName, String libraryName, Throwable t) Log a message indicating a particular resource (reference by name and/or library) could not be found. If this was due to an exception, the exception provided will be logged as well.
| |
| logMissingResource | back to summary |
|---|---|
| private void logMissingResource(FacesContext ctx, String resourceId, Throwable t) Log a message indicating a particular resource (reference by name and/or library) could not be found. If this was due to an exception, the exception provided will be logged as well.
| |
| normalizeResourceRequest | back to summary |
|---|---|
| private String normalizeResourceRequest(FacesContext context) Normalize the request path to exclude JSF invocation information. If the FacesServlet servicing this request was prefix mapped, then the path to the FacesServlet will be removed. If the FacesServlet servicing this request was extension mapped, then the extension will be trimmed off.
| |
| send304 | back to summary |
|---|---|
| private void send304(FacesContext ctx) | |
| send404 | back to summary |
|---|---|
| private void send404(FacesContext ctx, String resourceName, String libraryName, boolean logMessage) | |
| send404 | back to summary |
|---|---|
| private void send404(FacesContext ctx, String resourceName, String libraryName, Throwable t, boolean logMessage) | |
| setCreationTime | back to summary |
|---|---|
| pack-priv void setCreationTime(long creationTime) This method is here soley for the purpose of unit testing and will not be invoked during normal runtime.
| |