Top Fields Constructors Methods
com.sun.faces.application.resource

public Class FaceletWebappResourceHelper

extends ResourceHelper
Class Inheritance
Static Imports
com.sun.faces.RIConstants.FLOW_IN_JAR_PREFIX, com.sun.faces.config.WebConfiguration.META_INF_CONTRACTS_DIR, .WebConfiguration.WebContextInitParameter.FaceletsSuffix, jakarta.faces.application.ResourceVisitOption.TOP_LEVEL_VIEWS_ONLY, java.util.Spliterator.DISTINCT, .Spliterators.spliteratorUnknownSize, java.util.stream.StreamSupport.stream

Field Summary

Modifier and TypeField and Description
private final String[]
private static final String[]
private final ResourceHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
createPath(LibraryInfo library, String resourceName)

public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public LibraryInfo
findLibrary(String
the name of the library
libraryName
,
String
the logicial identifier for a locale specific library. if no localePrefix is configured, pass null
localePrefix
,
String
the name of the contract
contract
,
FacesContext
the jakarta.faces.context.FacesContext for the current request @return a LibraryInfo if a matching library based off the inputs can be found, otherwise returns null
ctx
)

Implements abstract com.sun.faces.application.resource.ResourceHelper.findLibrary.

Search for the specified library/localPrefix combination in an implementation dependent manner.

public ResourceInfo
findResource(LibraryInfo
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
library
,
String
the name of the resource that is being searched for
resourceName
,
String
the logicial identifier for a locale specific library. if no localePrefix is configured, pass null
localePrefix
,
boolean
true if the resource can be compressed
compressable
,
FacesContext
the jakarta.faces.context.FacesContext for the current request
ctx
)

Implements abstract com.sun.faces.application.resource.ResourceHelper.findResource.

Search for the specified resource based in the library/localePrefix/resourceName combination in an implementation dependent manner.

private URL
findResourceInfoConsideringContracts(FacesContext ctx, String baseResourceName, ContractInfo[] outContract, List<String> contracts)

private URL
findResourceUrlConsideringFlows(String resourceName, boolean[] outDoNotCache)

public String
public String
protected InputStream
getNonCompressedInputStream(ResourceInfo
the resource to obtain an InputStream to
info
,
FacesContext
the FacesContext for the current request
ctx
)

Implements abstract com.sun.faces.application.resource.ResourceHelper.getNonCompressedInputStream.

If a ResourceInfo is not compressable, getInputStream(ResourceInfo, jakarta.faces.context.FacesContext) will call this method to return a stream to the actual resource.

private static String[]
public URL
getURL(ResourceInfo
the resource to obtain a URL reference to
resource
,
FacesContext
the FacesContext for the current request
ctx
)

Implements abstract com.sun.faces.application.resource.ResourceHelper.getURL.

public Stream<String>
getViewResources(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from com.sun.faces.application.resource.ResourceHelper:
clientAcceptsCompressioncompressContentgetBasePathgetInputStreamgetLastModifiedgetLocalizedPathsgetVersionhandleCompressionresourceSupportsELtrimLeadingSlash

Field Detail

configuredExtensionsback to summary
private final String[] configuredExtensions
RESTRICTED_DIRECTORIESback to summary
private static final String[] RESTRICTED_DIRECTORIES
webappResourceHelperback to summary
private final ResourceHelper webappResourceHelper

Constructor Detail

FaceletWebappResourceHelperback to summary
public FaceletWebappResourceHelper(WebappResourceHelper webappResourceHelper)

Method Detail

createPathback to summary
private String createPath(LibraryInfo library, String resourceName)
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
findLibraryback to summary
public LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx)

Implements abstract com.sun.faces.application.resource.ResourceHelper.findLibrary.

Doc from com.sun.faces.application.resource.ResourceHelper.findLibrary.

Search for the specified library/localPrefix combination in an implementation dependent manner.

Parameters
libraryName:String

the name of the library

localePrefix:String

the logicial identifier for a locale specific library. if no localePrefix is configured, pass null

contract:String

the name of the contract

ctx:FacesContext

the jakarta.faces.context.FacesContext for the current request @return a LibraryInfo if a matching library based off the inputs can be found, otherwise returns null

Returns:LibraryInfo

library info

Annotations
@Override
findResourceback to summary
public ResourceInfo findResource(LibraryInfo library, String resourceName, String localePrefix, boolean compressable, FacesContext ctx)

Implements abstract com.sun.faces.application.resource.ResourceHelper.findResource.

Doc from com.sun.faces.application.resource.ResourceHelper.findResource.

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 handleCompression(com.sun.faces.application.resource.ClientResourceInfo) to compress the content.

Parameters
library:LibraryInfo

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:String

the name of the resource that is being searched for

localePrefix:String

the logicial identifier for a locale specific library. if no localePrefix is configured, pass null

compressable:boolean

true if the resource can be compressed

ctx:FacesContext

the jakarta.faces.context.FacesContext for the current request

Returns:ResourceInfo

a ResourceInfo if a matching resource based off the inputs can be found, otherwise returns null

Annotations
@Override
findResourceInfoConsideringContractsback to summary
private URL findResourceInfoConsideringContracts(FacesContext ctx, String baseResourceName, ContractInfo[] outContract, List<String> contracts) throws MalformedURLException
findResourceUrlConsideringFlowsback to summary
private URL findResourceUrlConsideringFlows(String resourceName, boolean[] outDoNotCache) throws IOException
getBaseContractsPathback to summary
public String getBaseContractsPath()

Implements abstract com.sun.faces.application.resource.ResourceHelper.getBaseContractsPath.

Annotations
@Override
getBaseResourcePathback to summary
public String getBaseResourcePath()

Implements abstract com.sun.faces.application.resource.ResourceHelper.getBaseResourcePath.

Returns:String

Doc from com.sun.faces.application.resource.ResourceHelper.getBaseResourcePath.

the base path in which resources will be stored

Annotations
@Override
getNonCompressedInputStreamback to summary
protected InputStream getNonCompressedInputStream(ResourceInfo info, FacesContext ctx) throws IOException

Implements abstract com.sun.faces.application.resource.ResourceHelper.getNonCompressedInputStream.

Doc from com.sun.faces.application.resource.ResourceHelper.getNonCompressedInputStream.

If a ResourceInfo is not compressable, getInputStream(ResourceInfo, jakarta.faces.context.FacesContext) will call this method to return a stream to the actual resource.

Parameters
info:ResourceInfo

the resource to obtain an InputStream to

ctx:FacesContext

the FacesContext for the current request

Returns:InputStream

an InputStream to the resource

Annotations
@Override
Exceptions
IOException:
if an error occurs obtaining the stream
getRestrictedDirectoriesback to summary
private static String[] getRestrictedDirectories(final ResourceVisitOption... options)
getURLback to summary
public URL getURL(ResourceInfo resource, FacesContext ctx)

Implements abstract com.sun.faces.application.resource.ResourceHelper.getURL.

Parameters
resource:ResourceInfo

Doc from com.sun.faces.application.resource.ResourceHelper.getURL.

the resource to obtain a URL reference to

ctx:FacesContext

Doc from com.sun.faces.application.resource.ResourceHelper.getURL.

the FacesContext for the current request

Returns:URL

Doc from com.sun.faces.application.resource.ResourceHelper.getURL.

a URL to the specified resource, otherwise null if no resource is found

Annotations
@Override
getViewResourcesback to summary
public Stream<String> getViewResources(FacesContext facesContext, String path, int maxDepth, ResourceVisitOption... options)
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override