80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * The contents of this file are subject to the terms
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * of the Common Development and Distribution License
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * (the License). You may not use this file except in
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * compliance with the License.
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * You can obtain a copy of the License at
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * https://opensso.dev.java.net/public/CDDLv1.0.html or
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * See the License for the specific language governing
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * permission and limitations under the License.
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * When distributing Covered Code, include this CDDL
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * Header Notice in each file and include the License file
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * If applicable, add the following below the CDDL Header,
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * with the fields enclosed by brackets [] replaced by
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * your own identifying information:
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * "Portions Copyrighted [year] [name of copyright owner]"
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * $Id: HomeDirLocator.java,v 1.3 2008/06/25 05:52:11 qcheng Exp $
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperpackage com.sun.identity.agents.install.appserver.v81;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.configurator.IStateAccess;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.configurator.InstallException;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.configurator.IServerHomeDirLocator;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.util.FileUtils;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.util.LocalizedMessage;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.install.tools.util.Debug;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperimport com.sun.identity.agents.install.appserver.IConfigKeys;
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * Home directory locator for AS81 agent
80c77071c6700660c39046da32a0d7953620f608Mark de Reeperpublic class HomeDirLocator implements IServerHomeDirLocator,
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper public String getServerDirectory (IStateAccess state)
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper // Home dir is same as domain config dir for as81 onwards
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper String asConfigDir = (String)state.get(STR_KEY_AS_INST_CONFIG_DIR);
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper if ((asConfigDir != null) && (asConfigDir.length() > 0)) {
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper Debug.log("HomeDirLocator: The server home " +
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper serverHomeDir + ", directory specified is invalid:");
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper LocalizedMessage.get(LOC_AS_ERR_IN_VALID_HOME_DIR, STR_AS_GROUP));
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper //Update the state information
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper state.put(STR_KEY_AS_HOME_DIR,serverHomeDir);
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper Debug.log("HomeDirLocator : Application server home " +
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper * Localized constants
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper public static String LOC_AS_ERR_IN_VALID_HOME_DIR =
80c77071c6700660c39046da32a0d7953620f608Mark de Reeper "AS_ERR_IN_VALID_HOME_DIR";