Class Utils


  • public class Utils
    extends Object
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • progressPercentage

        public static void progressPercentage​(int remain,
                                              int total,
                                              String prefix)
      • askYesNo

        public static boolean askYesNo​(String question)
      • askYesNo

        public static boolean askYesNo​(String question,
                                       String positive,
                                       String negative)
      • getExternalPolicyName

        public static String getExternalPolicyName​(String policy)
      • substituteVariables

        public static String substituteVariables​(File inputFile)
                                          throws IOException
        This method is replacing variables such as ${TokenEndpoint} in the given file with declared variables coming from either the Environment-Variables or from system-properties.
        Parameters:
        inputFile - The API-Config file to be replaced and returned as String
        Returns:
        a String representation of the API-Config-File
        Throws:
        IOException - if the file can't be found
      • getStageConfig

        public static File getStageConfig​(String stage,
                                          String stageConfig,
                                          File baseConfigFile)
        Parameters:
        stage - defines a stage which identifies a prod or qa environment.
        stageConfig - can be given to define the stage config file to be used
        baseConfigFile - the base configuration
        Returns:
        the staged config file
      • getInstallFolder

        public static File getInstallFolder()
      • getAPILogString

        public static String getAPILogString​(API api)
      • isHttpUri

        public static boolean isHttpUri​(String pathToAPIDefinition)
      • ignoreBasePath

        public static String ignoreBasePath​(String serverUrl)
      • compareValues

        public static boolean compareValues​(Object actualValue,
                                            Object desiredValue)
      • getEncryptedPassword

        public static String getEncryptedPassword()