Namespace src/Cache

src/Cache

Overview

Directory src/Cache

file source src/Cache/getFileContentIfNotExpired.sh

Cache::getFileContentIfNotExpired

get file content if file not expired

Arguments
  • $1 (file:String): the file to get content from
  • $2 (maxDuration:int): number of seconds after which the file is considered expired
Exit codes
  • 1: if file does not exists
  • 2: if file expired
Output on stdout
  • {String} the file content if not expired

src/Cache/getPropertyValue.sh

file source src/Cache/getPropertyValue.sh

Cache::getPropertyValue

Deprecated use Cache::getPropertyValue2 instead

get property value from file if not present compute it using propertyNotFoundCallback (if provided) and store it in property file

Arguments
  • $1 (propertyFile:String): the file in which the property will be searched
  • $2 (key:String): the property key to search in property file
  • $3 (propertyNotFoundCallback:Function): (optional) a callback to call if property key is not found in property file
  • (args:String[]): (optional) the arguments to pass to the propertyNotFoundCallback
Exit codes
  • 1: if value is not found
    • if propertyNotFoundCallback fails
Output on stdout
  • the property value given by property file or by the propertyNotFoundCallback

src/Cache/getPropertyValue2.sh

file source src/Cache/getPropertyValue2.sh

Cache::getPropertyValue2

get property value from file if not present compute it using propertyNotFoundCallback (if provided) and store it in property file

Arguments
  • $1 (propertyFile:String): the file in which the property will be searched
  • $2 (key:String): the property key to search in property file
  • $3 (propertyNotFoundCallback:Function): (optional) a callback to call if property key is not found in property file
  • (args:String[]): (optional) the arguments to pass to the propertyNotFoundCallback
Exit codes
  • 1: if value is not found
    • if propertyNotFoundCallback fails
Output on stdout
  • the property value given by property file or by the propertyNotFoundCallback
Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.