public class WebappResourceHelper extends ResourceHelper
A ResourceHelper
implementation for finding/serving resources
found within <contextroot>/resources
directory of a
web application.
Constructor and Description |
---|
WebappResourceHelper() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
LibraryInfo |
findLibrary(String libraryName,
String localePrefix,
String contract,
FacesContext ctx)
Search for the specified library/localPrefix combination in an
implementation dependent manner.
|
ResourceInfo |
findResource(LibraryInfo library,
String resourceName,
String localePrefix,
boolean compressable,
FacesContext ctx)
Search for the specified resource based in the library/localePrefix/resourceName
combination in an implementation dependent manner.
|
String |
getBaseContractsPath() |
String |
getBaseResourcePath() |
protected InputStream |
getNonCompressedInputStream(ResourceInfo resource,
FacesContext ctx)
If a
ResourceInfo is not compressable, ResourceHelper.getInputStream(ResourceInfo, javax.faces.context.FacesContext)
will call this method to return a stream to the actual resource. |
URL |
getURL(ResourceInfo resource,
FacesContext ctx) |
int |
hashCode() |
clientAcceptsCompression, compressContent, getBasePath, getInputStream, getLastModified, getVersion, handleCompression, resourceSupportsEL, trimLeadingSlash
public String getBaseResourcePath()
getBaseResourcePath
in class ResourceHelper
ResourceHelper.getBaseResourcePath()
public String getBaseContractsPath()
getBaseContractsPath
in class ResourceHelper
protected InputStream getNonCompressedInputStream(ResourceInfo resource, FacesContext ctx) throws IOException
ResourceHelper
ResourceInfo
is not compressable, ResourceHelper.getInputStream(ResourceInfo, javax.faces.context.FacesContext)
will call this method to return a stream to the actual resource.getNonCompressedInputStream
in class ResourceHelper
resource
- the resource to obtain an InputStream toctx
- the FacesContext
for the current requestIOException
- if an error occurs obtaining the streamResourceHelper.getNonCompressedInputStream(com.sun.faces.application.resource.ResourceInfo, javax.faces.context.FacesContext)
public URL getURL(ResourceInfo resource, FacesContext ctx)
getURL
in class ResourceHelper
resource
- the resource to obtain a URL reference toctx
- the FacesContext
for the current requestnull
if no resource is foundResourceHelper.getURL(com.sun.faces.application.resource.ResourceInfo, javax.faces.context.FacesContext)
public LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx)
ResourceHelper
findLibrary
in class ResourceHelper
libraryName
- the name of the librarylocalePrefix
- the logicial identifier for a locale specific library.
if no localePrefix is configured, pass null
contract
- the name of the contractctx
- the FacesContext
for the current request @return a LibraryInfo
if a matching library based off the inputs
can be found, otherwise returns null
ResourceHelper.findLibrary(String, String, String, javax.faces.context.FacesContext)
public ResourceInfo findResource(LibraryInfo library, String resourceName, String localePrefix, boolean compressable, FacesContext ctx)
ResourceHelper
Search for the specified resource based in the library/localePrefix/resourceName combination in an implementation dependent manner.
If the resource is found, and is compressable, call ResourceHelper.handleCompression(com.sun.faces.application.resource.ClientResourceInfo)
to compress the content.
findResource
in class ResourceHelper
library
- the library this resource should be a part of. If the
the resource that is being searched for isn't part of a library, then
pass null
resourceName
- the name of the resource that is being searched forlocalePrefix
- the logicial identifier for a locale specific library.
if no localePrefix is configured, pass null
compressable
- true
if the resource can be compressedctx
- the FacesContext
for the current requestResourceInfo
if a matching resource based off the inputs
can be found, otherwise returns null
ResourceHelper.findResource(LibraryInfo, String, String, boolean, javax.faces.context.FacesContext)
Comments to: faces-dev@eclipse.org.
Copyright © 2019 Eclipse Foundation. All rights reserved.
Use is subject to license terms.