| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | COMPRESSED_CONTENT_FILENAME
Arbitrary file name to write the compressed bits to. |
| private static final String[] | |
| private static final Pattern | LIBRARY_VERSION_PATTERN
This pattern represents a version for a library. |
| private static final Logger | |
| private static final Pattern | RESOURCE_VERSION_PATTERN
This pattern represents a version for a resource. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | Returns: true if compressed content can be sent to the client, otherwise falsethe ctx)FacesContext for the current request
This method attempt to verify that the user agent can accept a gzip encoded response by interrogating the
|
| protected boolean | Returns: true if compression succeeded and the compressed result is smaller than the original
content, otherwise falsethe resource to be compressed info)Utility method to compress the content of the original resource to the temporary directory specified by
|
| public abstract LibraryInfo | Returns: library infothe name of the library libraryName, String the logicial identifier for a locale specific library. if no localePrefix is configured, pass
localePrefix, String nullthe name of the contract contract, FacesContext the ctx)jakarta. for the current request @return a LibraryInfo if a
matching library based off the inputs can be found, otherwise returns nullSearch for the specified library/localPrefix combination in an implementation dependent manner. |
| public abstract ResourceInfo | Returns: aResourceInfo if a matching resource based off the inputs can be found, otherwise returns
nullthe 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 library, String nullthe 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
localePrefix, boolean nulltrue if the resource can be compressedthe ctx)jakarta. for the current requestSearch for the specified resource based in the library/localePrefix/resourceName combination in an implementation dependent manner. |
| public abstract String | |
| protected String | |
| public abstract String | |
| public InputStream | Returns: anInputStream to the resource, or null if no resource is foundthe resource to obtain an InputStream to toStream, FacesContext the ctx)jakarta. for the current request
If the resource is compressable, return an InputStream to read the compressed content, otherwise, call
|
| private InputStream | |
| public long | Returns: the date of the resource in milliseconds (since epoch), or0 if the date cannot be determinedthe resource in question resource, FacesContext the ctx)FacesContext for the current request
The default implementation of this method will call through to
|
| protected List | |
| protected abstract InputStream | Returns: an InputStream to the resourcethe resource to obtain an InputStream to info, FacesContext the ctx)FacesContext for the current requestIf a |
| public abstract URL | Returns: a URL to the specified resource, otherwisenull if no resource is foundthe resource to obtain a URL reference to resource, FacesContext the ctx)FacesContext for the current request
|
| protected VersionInfo | Returns: the latest version or if no version can be detected, otherwise this method returnsnulla collection of paths (consisting of single path elements) resourcePaths, boolean true if the version being looked up is for a reource, otherwise, pass
false if the version is a library versionGiven a collection of path names: 1.1, scripts, images, 1.2 |
| private VersionInfo | Returns: true if this path element represents a version (i.e. matches LIBRARY_VERSION_PATTERN),
otherwise returns falsethe path element to verify pathElement, boolean true if the version being looked up is for a reource, otherwise, pass
false if the version is a library version
|
| protected ClientResourceInfo | Returns: the ResourceInfo after compression is complete. If compression was successful, this should be the same instance. If compression was not successful, it will be a different instance than what was passed.the resource to compression resource)Utility method to peform the necessary actions to compress content. |
| private ClientResourceInfo | |
| protected boolean | |
| protected String |
| COMPRESSED_CONTENT_FILENAME | back to summary |
|---|---|
| private static final String COMPRESSED_CONTENT_FILENAME Arbitrary file name to write the compressed bits to. | |
| EL_CONTENT_TYPES | back to summary |
|---|---|
| private static final String[] EL_CONTENT_TYPES | |
| LIBRARY_VERSION_PATTERN | back to summary |
|---|---|
| private static final Pattern LIBRARY_VERSION_PATTERN This pattern represents a version for a library. Examples: 1_1 1_11 1_11_1 1_11_1_2 | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| RESOURCE_VERSION_PATTERN | back to summary |
|---|---|
| private static final Pattern RESOURCE_VERSION_PATTERN This pattern represents a version for a resource. Examples: 1_1.jpg 1_11.323 1_11_1.gif 1_11_1_2.txt 1_1 1_11 1_11_1 1_11_1_2 The extension is optional. | |
| ResourceHelper | back to summary |
|---|---|
| public ResourceHelper() | |
| clientAcceptsCompression | back to summary |
|---|---|
| protected boolean clientAcceptsCompression(FacesContext ctx)
This method attempt to verify that the user agent can accept a gzip encoded response by interrogating the
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html RFC 2616, sec. 14 for details on the accept-encoding header. Implementation Note It is safe to cast to a
| |
| compressContent | back to summary |
|---|---|
| protected boolean compressContent(ClientResourceInfo info) throws IOException Utility method to compress the content of the original resource to the temporary directory specified by
| |
| findLibrary | back to summary |
|---|---|
| public abstract LibraryInfo findLibrary(String libraryName, String localePrefix, String contract, FacesContext ctx) Search for the specified library/localPrefix combination in an implementation dependent manner.
| |
| findResource | back to summary |
|---|---|
| public abstract 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.
If the resource is found, and is compressable, call
| |
| getBaseContractsPath | back to summary |
|---|---|
| public abstract String getBaseContractsPath() | |
| getBasePath | back to summary |
|---|---|
| protected String getBasePath(String contract) | |
| getBaseResourcePath | back to summary |
|---|---|
public abstract String getBaseResourcePath()
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream(ResourceInfo toStream, FacesContext ctx) throws IOException
If the resource is compressable, return an InputStream to read the compressed content, otherwise, call
Implementation Note If any exception occurs trying to return a stream to the compressed content, log the exception, and instead try to return a stream to the original content.
| |
| getInputStreamFromClientInfo | back to summary |
|---|---|
| private InputStream getInputStreamFromClientInfo(ClientResourceInfo resource, FacesContext ctx) throws IOException | |
| getLastModified | back to summary |
|---|---|
| public long getLastModified(ResourceInfo resource, FacesContext ctx)
The default implementation of this method will call through to
| |
| getLocalizedPaths | back to summary |
|---|---|
| protected List | |
| getNonCompressedInputStream | back to summary |
|---|---|
| protected abstract InputStream getNonCompressedInputStream(ResourceInfo info, FacesContext ctx) throws IOException If a
| |
| getURL | back to summary |
|---|---|
public abstract URL getURL(ResourceInfo resource, FacesContext ctx)
| |
| getVersion | back to summary |
|---|---|
| protected VersionInfo getVersion(Collection<String> resourcePaths, boolean isResource) Given a collection of path names: 1.1, scripts, images, 1.2 this method will pick out the directories that represent a library or resource version and return the latest version found, if any.
| |
| getVersion | back to summary |
|---|---|
private VersionInfo getVersion(String pathElement, boolean isResource)
| |
| handleCompression | back to summary |
|---|---|
| protected ClientResourceInfo handleCompression(ClientResourceInfo resource) Utility method to peform the necessary actions to compress content.
Implmentation Note: If an exception occurs while compressing the content, log the IOException and rebuilt the
| |
| rebuildAsNonCompressed | back to summary |
|---|---|
| private ClientResourceInfo rebuildAsNonCompressed(ClientResourceInfo resource) | |
| resourceSupportsEL | back to summary |
|---|---|
| protected boolean resourceSupportsEL(String resourceName, String libraryName, FacesContext ctx) | |
| trimLeadingSlash | back to summary |
|---|---|
| protected String trimLeadingSlash(String s) | |
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final FacesContext | |
| private boolean | |
| private boolean | |
| private boolean | |
| private final ClientResourceInfo | |
| private final InputStream | |
| private int | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| private void | |
| private boolean | |
| public int | read()
Implements abstract java. Reads the next byte of data from the input stream. |
| private void |
| buf | back to summary |
|---|---|
| private final List<Integer> buf | |
| ctx | back to summary |
|---|---|
| private final FacesContext ctx | |
| endOfStreamReached | back to summary |
|---|---|
| private boolean endOfStreamReached | |
| expressionEvaluated | back to summary |
|---|---|
| private boolean expressionEvaluated | |
| failedExpressionTest | back to summary |
|---|---|
| private boolean failedExpressionTest | |
| info | back to summary |
|---|---|
| private final ClientResourceInfo info | |
| inner | back to summary |
|---|---|
| private final InputStream inner | |
| nextRead | back to summary |
|---|---|
| private int nextRead | |
| writingExpression | back to summary |
|---|---|
| private boolean writingExpression | |
| ELEvaluatingInputStream | back to summary |
|---|---|
| public ELEvaluatingInputStream(FacesContext ctx, ClientResourceInfo info, InputStream inner) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream.
| |
| evaluateExpressionIntoBuffer | back to summary |
|---|---|
| private void evaluateExpressionIntoBuffer() | |
| isPropertyValid | back to summary |
|---|---|
| private boolean isPropertyValid(String property) | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements abstract java. Doc from java. Reads the next byte of data from the input stream. The value byte is
returned as an
| |
| readExpressionIntoBufferAndEvaluateIntoBuffer | back to summary |
|---|---|
| private void readExpressionIntoBufferAndEvaluateIntoBuffer() throws IOException | |