Class FileVar
The format for this var is
Contents of files are retrieved from the request using RestRequest.getStaticFiles()
.
Localized resources (based on the locale of the HTTP request) are supported.
For example, if looking for the resource
"MyResource_ja_JP.txt" "MyResource_ja.txt" "MyResource.txt"
Example:
Files of type HTML, XHTML, XML, JSON, Javascript, and CSS will be stripped of comments. This allows you to place license headers in files without them being serialized to the output.
This variable resolver requires that a RestRequest
bean be available in the session bean store.
See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canResolve
(VarResolverSession session) Returnstrue if this variable can be resolved in the specified session.resolve
(VarResolverSession session, String key) The interface that needs to be implemented for subclasses ofSimpleVar
.Methods inherited from class org.apache.juneau.svl.DefaultingVar
doResolve
Methods inherited from class org.apache.juneau.svl.Var
allowNested, allowRecurse, getName
-
Field Details
-
NAME
The name of this variable.- See Also:
-
-
Constructor Details
-
FileVar
public FileVar()Constructor.
-
-
Method Details
-
resolve
Description copied from class:Var
The interface that needs to be implemented for subclasses ofSimpleVar
. -
canResolve
Description copied from class:Var
Returnstrue if this variable can be resolved in the specified session.For example, some variable cannot resolve unless specific context or session objects are available.
- Overrides:
canResolve
in classVar
- Parameters:
session
- The current session.- Returns:
true if this variable can be resolved in the specified session.
-