AdminToolLauncher.java revision 3da5cf3207e849bd28031a5ef5e4550605fd66ed
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: AdminToolLauncher.java,v 1.5 2009/04/07 17:18:37 leiming Exp $
*
*/
/*
* Portions Copyrighted [2010] [ForgeRock AS]
*/
public class AdminToolLauncher {
if (index != -1) {
}
}
// This urlString is URL-encoded, decode it.
if (entryIndex != -1) {
.length(), entryIndex);
if (jarNameIndex != -1) {
} else {
}
} else {
throw new Exception("Failed to locate jar entry in: "
+ urlString);
}
}
if (jarFileName == null) {
}
- relativePath.length());
// Detect some commonly used special characters, which are not
// allowed in Agent deployment directory.
throw new IOException(
"Agent deployment directory may have special " +
"character(% #+), rename it to a new directory name.");
}
// Product home must exist
// Product bin dir must exist
false));
// Config dir must exist
+ STR_CONFIG_DIR_PREFIX, false));
// Data dir: create if does not exist
+ STR_DATA_DIR_PREFIX, true));
// Etc dir: create if does not exist
true));
// Set JCE dir
productHome + STR_JCE_DIR_PREFIX, false));
}
// Set JSSE dir
productHome + STR_JSSE_DIR_PREFIX, false));
}
// Lib dir must exist
false));
// Locale dir must exist
+ STR_LOCALE_DIR_PREFIX, false));
// pathURLs.add(getProductLocaleDir().toURL());
// Logs dir: create if does not exist
+ STR_LOGS_DIR_PREFIX, true));
if (!isJDK14OrAbove()) {
}
.size());
debug("Context thread loader has been set.");
try {
"Error: the Exception might be caused by " +
"special character in Agent deployment directory.");
throw ex;
}
// Passing null for parameterTypes because there are no arguments and
// it is a static method - hence no instance of class.
Class[] parameterTypes = {};
// Since the call is for static method, the first parameter to the
// invoke method is null.
Object[] methodArguments = {};
}
throws Exception {
if (!dir.isDirectory()) {
} else {
}
} else {
if (create) {
} else {
}
} else {
}
}
return dir;
}
throws SecurityException {
boolean isDirExisting = false;
}
return isDirExisting;
}
.length() - 1);
}
}
}
throws Exception {
}
}
}
}
}
private static void initJavaVersion() throws Exception {
int secondSeparatorIndex = version
if (code < 13) {
} else if (code == 13) {
setIsJDK14OrAbove(false);
} else if (code > 13) {
setIsJDK14OrAbove(true);
}
}
try {
boolean debugEnabled = false;
debugEnabled = true;
} else {
}
}
}
}
}
private static String getLauncherJarFileName() {
return jarFileName;
}
{
}
}
}
private static File getProductLibDir() {
return productLibDir;
}
}
}
}
private static File getProductEtcDir() {
return productEtcDir;
}
private static File getProductBinDir() {
return productBinDir;
}
private static File getProductHomeDir() {
return productHomeDir;
}
private static void setDebugEnabledFlag(boolean debugEnbled) {
.valueOf(debugEnabled));
}
private static boolean isDebugEnabled() {
return debugEnabled;
}
if (isDebugEnabled()) {
}
}
private static File getProductLocaleDir() {
return productLocaleDir;
}
}
private static ArrayList getClassPathElements() {
return classPathElements;
}
}
private static boolean isJDK14OrAbove() {
return isJDK14orAbove;
}
private static void setIsJDK14OrAbove(boolean flag) {
}
private static File getProductJCEDir() {
return productJCEDir;
}
}
private static File getProductJSSEDir() {
return productJSSEDir;
}
}
private static File getProductConfigDir() {
return productConfigDir;
}
}
private static File getProductLogsDir() {
return productLogsDir;
}
}
private static File getProductDataDir() {
return productDataDir;
}
}
private static String jarFileName;
private static File productHomeDir;
private static File productBinDir;
private static File productLibDir;
private static File productConfigDir;
private static File productLocaleDir;
private static File productJCEDir;
private static File productJSSEDir;
private static File productLogsDir;
private static File productDataDir;
private static File productEtcDir;
private static boolean debugEnabled;
private static ArrayList classPathElements;
private static boolean isJDK14orAbove;
private static final String STR_TOOLS_CONFIGURATION_CLASSNAME =
"com.sun.identity.install.tools.admin.ToolsConfiguration";
private static final String STR_TOOLS_CONFIGURATION_METHODNAME =
"getAdminTool";
}