Class CLIHelper

java.lang.Object
de.foellix.aql.helper.CLIHelper

public class CLIHelper extends Object
  • Field Details

    • initialConfigAvailable

      public static boolean initialConfigAvailable
    • lastConfigFileHashLoaded

      public static String lastConfigFileHashLoaded
  • Constructor Details

    • CLIHelper

      public CLIHelper()
  • Method Details

    • evaluateLogLevel

      public static int evaluateLogLevel(String debug)
    • evaluateLogLevel

      public static int evaluateLogLevel(String debug, boolean setImmediately)
    • evaluateConfig

      public static boolean evaluateConfig(String config)
    • evaluateRules

      public static boolean evaluateRules(String rules)
    • evaluateTimeout

      public static long evaluateTimeout(String readTimeout)
      Return the timeout in seconds
      Parameters:
      readTimeout - Examples: 100s, 5m, 1h
      Returns:
      the timeout in seconds
    • evaluateTimeoutMode

      public static int evaluateTimeoutMode(String readTimeoutMode)
      Helps dealing with timeouts set in config and via launch parameter. Returns the timeout mode which might be max, min or override.
      Parameters:
      readTimeoutMode - the launch parameter read.
      Returns:
      the mode detected. Returns -1 if no mode selection was given.
    • checkResources

      public static void checkResources()
      Checks if the AQL-System or tool using is, is run from the correct location. If not, it terminates the execution.
    • getStage

      public static javafx.stage.Stage getStage()
      Get stage for offering the Configuration wizard
      Returns:
      the stage offered
    • setStage

      public static void setStage(javafx.stage.Stage stage)
      Sets an alternative stage for offering the Configuration wizard
      Parameters:
      stage - the stage offered
    • replaceQuotesWithNeedles

      public static String replaceQuotesWithNeedles(String arg)
      Replaces Quotes (") with %QUOTE%.
      Parameters:
      arg -
      Returns:
    • replaceNeedlesWithQuotes

      public static String replaceNeedlesWithQuotes(String arg)
      Replaces %QUOTE% with Quotes (").
      Parameters:
      arg -
      Returns:
    • replaceNeedlesWithQuotes

      public static String[] replaceNeedlesWithQuotes(String[] args)
      Replaces %QUOTE% with Quotes (").
      Parameters:
      args -
      Returns:
    • removeQuotesFromFileString

      public static String removeQuotesFromFileString(String fileString)
    • escapeChars

      public static String escapeChars(String str)
      Escapes "$" symbols
      Parameters:
      str - String with "$" symbols
      Returns:
      same String but "$" is replaced by "\$"