Class FaceletWebappResourceHelper
- java.lang.Object
-
- com.sun.faces.application.resource.ResourceHelper
-
- com.sun.faces.application.resource.FaceletWebappResourceHelper
-
public class FaceletWebappResourceHelper extends ResourceHelper
-
-
Constructor Summary
Constructors Constructor Description FaceletWebappResourceHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)LibraryInfofindLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx)Search for the specified library/localPrefix combination in an implementation dependent manner.ResourceInfofindResource(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.StringgetBaseContractsPath()StringgetBaseResourcePath()protected InputStreamgetNonCompressedInputStream(ResourceInfo info, FacesContext ctx)If aResourceInfois not compressable,ResourceHelper.getInputStream(ResourceInfo, jakarta.faces.context.FacesContext)will call this method to return a stream to the actual resource.URLgetURL(ResourceInfo resource, FacesContext ctx)Stream<String>getViewResources(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)inthashCode()-
Methods inherited from class com.sun.faces.application.resource.ResourceHelper
clientAcceptsCompression, compressContent, getBasePath, getInputStream, getLastModified, getLocalizedPaths, getVersion, handleCompression, resourceSupportsEL, trimLeadingSlash
-
-
-
-
Method Detail
-
findLibrary
public LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx)
Description copied from class:ResourceHelperSearch for the specified library/localPrefix combination in an implementation dependent manner.- Specified by:
findLibraryin classResourceHelper- Parameters:
libraryName- the name of the librarylocalePrefix- the logicial identifier for a locale specific library. if no localePrefix is configured, passnullcontract- the name of the contractctx- theFacesContextfor the current request @return aLibraryInfoif a matching library based off the inputs can be found, otherwise returnsnull- Returns:
- library info
-
findResource
public ResourceInfo findResource(LibraryInfo library, String resourceName, String localePrefix, boolean compressable, FacesContext ctx)
Description copied from class:ResourceHelperSearch 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.- Specified by:
findResourcein classResourceHelper- Parameters:
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 passnullresourceName- the name of the resource that is being searched forlocalePrefix- the logicial identifier for a locale specific library. if no localePrefix is configured, passnullcompressable-trueif the resource can be compressedctx- theFacesContextfor the current request- Returns:
- a
ResourceInfoif a matching resource based off the inputs can be found, otherwise returnsnull
-
getViewResources
public Stream<String> getViewResources(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
-
getBaseResourcePath
public String getBaseResourcePath()
- Specified by:
getBaseResourcePathin classResourceHelper- Returns:
- the base path in which resources will be stored
-
getBaseContractsPath
public String getBaseContractsPath()
- Specified by:
getBaseContractsPathin classResourceHelper
-
getNonCompressedInputStream
protected InputStream getNonCompressedInputStream(ResourceInfo info, FacesContext ctx) throws IOException
Description copied from class:ResourceHelperIf aResourceInfois not compressable,ResourceHelper.getInputStream(ResourceInfo, jakarta.faces.context.FacesContext)will call this method to return a stream to the actual resource.- Specified by:
getNonCompressedInputStreamin classResourceHelper- Parameters:
info- the resource to obtain an InputStream toctx- theFacesContextfor the current request- Returns:
- an InputStream to the resource
- Throws:
IOException- if an error occurs obtaining the stream
-
getURL
public URL getURL(ResourceInfo resource, FacesContext ctx)
- Specified by:
getURLin classResourceHelper- Parameters:
resource- the resource to obtain a URL reference toctx- theFacesContextfor the current request- Returns:
- a URL to the specified resource, otherwise
nullif no resource is found
-
-