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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanResolve(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
doResolveMethods 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
-
canResolve
Description copied from class:VarReturnstrue 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:
canResolvein classVar- Parameters:
session- The current session.- Returns:
true if this variable can be resolved in the specified session.
-
resolve
Description copied from class:VarThe interface that needs to be implemented for subclasses ofSimpleVar.
-