Class FileSystemInputBinding

java.lang.Object
com.invirgance.convirgance.web.binding.FileSystemInputBinding
All Implemented Interfaces:
Binding

@Wiring public class FileSystemInputBinding extends Object implements 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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Iterable<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>
    Returns the current Input of the JSONObject
    Gets the current path of the bound JSONObject.
    void
    setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input)
    Sets the JSONObject's Input
    void
    Sets the file system path.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileSystemInputBinding

      public FileSystemInputBinding()
  • Method Details

    • getInput

      public com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> getInput()
      Returns the current Input of the JSONObject
      Returns:
      The Input to the JSONObject.
    • setInput

      public void setInput(com.invirgance.convirgance.input.Input<com.invirgance.convirgance.json.JSONObject> input)
      Sets the JSONObject's Input
      Parameters:
      input - The input type.
    • getPath

      public String getPath()
      Gets the current path of the bound JSONObject.
      Returns:
      The path.
    • setPath

      public void setPath(String path)
      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 interface Binding
      Parameters:
      parameters - Required by the Binding interface but not used in this implementation
      Returns:
      An Iterable of JSONObjects from the file