ConfigFinder.java revision 2be3e935b5cdea10ddcaf8afff4790d7ce09e950
0N/A/**
157N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
0N/A *
0N/A * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
0N/A *
0N/A * The contents of this file are subject to the terms
157N/A * of the Common Development and Distribution License
0N/A * (the License). You may not use this file except in
157N/A * compliance with the License.
0N/A *
0N/A * You can obtain a copy of the License at
0N/A * https://opensso.dev.java.net/public/CDDLv1.0.html or
0N/A * opensso/legal/CDDLv1.0.txt
0N/A * See the License for the specific language governing
0N/A * permission and limitations under the License.
0N/A *
0N/A * When distributing Covered Code, include this CDDL
0N/A * Header Notice in each file and include the License file
0N/A * at opensso/legal/CDDLv1.0.txt.
0N/A * If applicable, add the following below the CDDL Header,
157N/A * with the fields enclosed by brackets [] replaced by
157N/A * your own identifying information:
157N/A * "Portions Copyrighted [year] [name of copyright owner]"
0N/A *
0N/A * $Id: ConfigFinder.java,v 1.1 2009/01/21 18:43:53 kanduls Exp $
0N/A */
0N/A
0N/Apackage com.sun.identity.agents.tools.jetty.v61;
0N/A
0N/Aimport com.sun.identity.install.tools.configurator.IDefaultValueFinder;
0N/Aimport com.sun.identity.install.tools.configurator.IStateAccess;
0N/Aimport com.sun.identity.install.tools.util.OSChecker;
0N/A
0N/A
0N/Apublic class ConfigFinder implements IDefaultValueFinder,
0N/A IConstants, IConfigKeys {
public String getDefaultValue(String key, IStateAccess state,
String value) {
String result = null;
if (value != null) {
result = value;
} else {
result = getDefaultConfigDirectoryPath();
}
return result;
}
private String getDefaultConfigDirectoryPath() {
String result = null;
if (OSChecker.isWindows()) {
result = STR_CONFIG_DIR_WINDOWS;
} else if (OSChecker.isSolaris()){
result = STR_CONFIG_DIR_SOLARIS;
} else if (OSChecker.isLinux()) {
result = STR_CONFIG_DIR_LINUX;
}
return result;
}
}