Class FileSystemInputBinding
java.lang.Object
com.invirgance.convirgance.web.binding.FileSystemInputBinding
- All Implemented Interfaces:
Binding
Retrieves files from the file system.
FileSystemInputBinding allows services to access JSON files stored on the
server's file system. This is useful for data that may change without
redeploying the application, such as configuration files,
external data feeds, or shared resources.
Supports
${property}
variables for using Java
environment variables in the path.- Author:
- jbanes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionIterable
<com.invirgance.convirgance.json.JSONObject> getBinding
(com.invirgance.convirgance.json.JSONObject parameters) Retrieves and parses the file from the configured file system path.com.invirgance.convirgance.input.Input
<com.invirgance.convirgance.json.JSONObject> getInput()
Returns the currentInput
of theJSONObject
getPath()
Gets the current path of the bound JSONObject.void
setInput
(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Sets theJSONObject
'sInput
void
Sets the file system path.
-
Constructor Details
-
FileSystemInputBinding
public FileSystemInputBinding()
-
-
Method Details
-
getInput
public com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> getInput()Returns the currentInput
of theJSONObject
- Returns:
- The
Input
to the JSONObject.
-
setInput
public void setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input) Sets theJSONObject
'sInput
- Parameters:
input
- The input type.
-
getPath
Gets the current path of the bound JSONObject.- Returns:
- The path.
-
setPath
Sets the file system path. Spring expressions can be used. Example: value="#{systemProperties['database.root']}/data/customers.json"- Parameters:
path
- The location.
-
getBinding
public Iterable<com.invirgance.convirgance.json.JSONObject> getBinding(com.invirgance.convirgance.json.JSONObject parameters) Retrieves and parses the file from the configured file system path.- Specified by:
getBinding
in interfaceBinding
- Parameters:
parameters
- Required by the Binding interface but not used in this implementation- Returns:
- An
Iterable
ofJSONObject
s from the file
-