public class SetupUtils extends Object implements SetupConstants
ACCEPT_LICENSE, AIX, ALL, AM_VERSION, AM_VERSION_CURRENT, AM_VERSION_EXPECTED, AMCONFIG_PATH, BASE_DIR, BUFFER_SIZE, CHECK_VERSION, CONFIG_FILE, CONFIG_LOAD, CURRENT_PLATFORM, DEBUG_PATH, DEFAULT_PROPERTIES_FILE, DEFAULT_WILD_CARD, FILE_SEPARATOR, FROM_DIR, FROM_FILE, GZIP_EXT, JAVA_VERSION_CURRENT, JAVA_VERSION_EXPECTED, LINUX, LOG_PATH, OS_ARCH, OS_NAME, PATH_DEST, PRINT_HELP, QUESTION, REX_VAR_PREFIX, REX_VAR_SUFFIX, SETUP_PROPERTIES_FILE, SOLARIS, SUNOS, TO_DIR, TO_FILE, TOKEN, TOOLS_VERSION, USER_INPUT, VAR_PREFIX, VAR_SUFFIX, VERSION_FILE, WINDOWS, X64, X86, X86SOLARIS, XML_CONFIG, YES
Modifier and Type | Method and Description |
---|---|
static void |
copyAndFilterScripts(ResourceBundle bundle,
Properties lookupProp)
Copy and replace the variables in the scripts.
|
static String |
determineOS()
Determines the current operating system.
|
static void |
evaluateBundleValues(ResourceBundle bundle,
Properties lookupProp)
Lookups and set the resource bundle variables to the Properties
|
static String |
evaluatePropertiesValue(String value,
Properties lookupProp)
Lookups and replaces the variables in the string
|
static void |
getFiles(File fromDir,
File toDir,
String fromFilePattern,
String toFilePattern,
LinkedList fromFilesList,
LinkedList toFilesList)
Get the from files list and the to file list.
|
static Properties |
getTokens(ResourceBundle bundle,
Properties confProp)
Gets the map for text replacement.
|
static String |
getUserInput(String message)
Prompts user for input from system in.
|
static String |
getUserInput(String message,
String def) |
static Properties |
loadProperties(String fileName)
Loads properties from file.
|
static void |
printUsage(ResourceBundle bundle)
Prints the usage through system out.
|
static String |
transformFileName(String from,
String to,
File file)
Transform the file name by using string patterns.
|
static String |
transformFileName(String from,
String to,
File file,
char wildCard)
Transform the file name by using string patterns.
|
static void |
ungzip(String srcFile,
String destDir)
Ungzip the gzip archive from source file to destinated directory.
|
public static Properties loadProperties(String fileName) throws IOException
fileName
- The path to the properties file.IOException
public static String getUserInput(String message) throws IOException
message
- The text message to prompt the user.IOException
public static String getUserInput(String message, String def) throws IOException
IOException
public static Properties getTokens(ResourceBundle bundle, Properties confProp)
bundle
- The ResourceBundle which contains the tokens' name.confProp
- The properties which may contain the tokens value.public static String evaluatePropertiesValue(String value, Properties lookupProp)
value
- The string may contain variables which need to be replaced.lookupProp
- The properties may contain the real values.public static void getFiles(File fromDir, File toDir, String fromFilePattern, String toFilePattern, LinkedList fromFilesList, LinkedList toFilesList)
fromDir
- The directory of the source files locatedtoDir
- The directory of the destinated files locatedfromFilePattern
- The pattern of the name of source files.toFilePattern
- The pattern of the name of destinated files.fromFilesList
- (as return) List of files from the source directory.toFilesList
- (as return) List of files of the destinated directory.public static String determineOS()
public static String transformFileName(String from, String to, File file)
from
- The pattern of the source file.to
- The pattern of the destinated file.file
- The file to be transform.public static String transformFileName(String from, String to, File file, char wildCard)
from
- The pattern of the source file.to
- The pattern of the destinated file.file
- The file to be transform.wildCard
- The wildcard character is used in the string pattern.public static void ungzip(String srcFile, String destDir) throws IOException
srcFile
- The path to the source gzip archive.destDir
- The destinated directory for the decompression.IOException
public static void printUsage(ResourceBundle bundle)
bundle
- The ResourceBundle which contains the message.public static void evaluateBundleValues(ResourceBundle bundle, Properties lookupProp)
bundle
- The ResourceBundle is going to be evaluated.lookupProp
- The properties may contain the real values and the
storage of the results.public static void copyAndFilterScripts(ResourceBundle bundle, Properties lookupProp) throws IOException
bundle
- The ResourceBundle which contains the prompt messages.lookupProp
- The properties which contains the variables map, file
patterns, source directory, and destinated directory.IOException
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.