/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SetupUtils.java,v 1.7 2009/10/30 21:10:21 weisun2 Exp $
*
*/
/*
* Portions Copyrighted 2011-2013 ForgeRock AS
*/
private SetupUtils() {
}
/**
* Loads properties from file.
*
* @param fileName The path to the properties file.
* @return The Properties object of the specified propertoes file.
*/
throws IOException {
try {
} finally {
}
return prop;
}
/**
* Prompts user for input from system in.
*
* @param message The text message to prompt the user.
* @return The user input.
*/
throws IOException {
return userInput;
}
throws IOException {
}
/**
* Gets the map for text replacement.
*
* @param bundle The ResourceBundle which contains the tokens' name.
* @param confProp The properties which may contain the tokens value.
* @return The properties object as a map for text replacement.
*/
int tokensOffset = 0;
do {
if (commaIndex > tokensOffset) {
trim();
try{
} catch (MissingResourceException ex) {
}
if (tempVarValue != null) {
}
} else {
try{
} catch (MissingResourceException ex) {
}
} else {
break;
}
confProp);
if (tempVarValue != null) {
}
}
break;
}
} while (true);
return tokens;
}
/**
* Lookups and replaces the variables in the string
*
* @param value The string may contain variables which need to be replaced.
* @param lookupProp The properties may contain the real values.
* @return The String with variables replaced by correct value.
*/
return null;
}
if (lookupProp != null) {
int offset = 0;
int refPrefix = 0;
int refSuffix = 0;
refPrefix)) {
} else {
try {
} catch (IOException ignored) {
}
} else {
}
}
}
}
//offset = refSuffix + 1;
}
}
return returnValue;
}
/**
* Get the from files list and the to file list.
*
* @param fromDir The directory of the source files located
* @param toDir The directory of the destinated files located
* @param fromFilePattern The pattern of the name of source files.
* @param toFilePattern The pattern of the name of destinated files.
* @param fromFilesList (as return) List of files from the source directory.
* @param toFilesList (as return) List of files of the destinated directory.
*/
new GeneralFileFilter(fromFilePattern));
if (fromFiles[ i ].isDirectory()) {
} else {
toFilePattern, fromFiles[ i ])));
}
}
}
/**
* Determines the current operating system.
*
* @return The string to represent the current operating system.
*/
return WINDOWS;
} else {
return X86SOLARIS;
} else {
return LINUX;
}
}
} else {
return AIX;
} else {
return SOLARIS;
}
}
}
/**
* Transform the file name by using string patterns.
*
* @param from The pattern of the source file.
* @param to The pattern of the destinated file.
* @param file The file to be transform.
* @return The transformed name of the file.
*/
}
/**
* Transform the file name by using string patterns.
*
* @param from The pattern of the source file.
* @param to The pattern of the destinated file.
* @param file The file to be transform.
* @param wildCard The wildcard character is used in the string pattern.
* @return The transformed name of the file.
*/
char wildCard) {
if (file.isDirectory()) {
} else {
int fileNameOffset = 0;
boolean matched = true;
}
if (matchedIndex >= fileNameOffset) {
if (matchedIndex != fileNameOffset) {
} else {
if (matchedIndex +
}
}
}
} else {
matched = false;
break;
}
}
}
} else {
matched = false;
break;
}
buffer = new StringBuffer();
}
}
}
if (matched) {
} else {
}
}
}
return nameToReturn.toString();
}
}
return null;
}
/**
* Ungzip the gzip archive from source file to destinated directory.
*
* @param srcFile The path to the source gzip archive.
* @param destDir The destinated directory for the decompression.
*/
FILE_SEPARATOR) + 1);
byte[] buffer = new byte[BUFFER_SIZE];
int byteRead = 0;
}
}
}
/**
* Prints the usage through system out.
* @param bundle The ResourceBundle which contains the message.
*/
}
/**
* Lookups and set the resource bundle variables to the Properties
*
* @param bundle The ResourceBundle is going to be evaluated.
* @param lookupProp The properties may contain the real values and the
* storage of the results.
*/
while (propNames.hasMoreElements()) {
}
}
}
/**
* Copy and replace the variables in the scripts.
*
* @param bundle The ResourceBundle which contains the prompt messages.
* @param lookupProp The properties which contains the variables map, file
* patterns, source directory, and destinated directory.
*/
if (toDir.isAbsolute()) {
}
}
try {
"permission.scripts"));
}
} catch (InterruptedException ex) {
"permission.scripts"));
//ex.printStackTrace();
}
}
}
}