de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * The contents of this file are subject to the terms
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * of the Common Development and Distribution License
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * (the License). You may not use this file except in
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * compliance with the License.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * You can obtain a copy of the License at
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * https://opensso.dev.java.net/public/CDDLv1.0.html or
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * See the License for the specific language governing
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * permission and limitations under the License.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * When distributing Covered Code, include this CDDL
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Header Notice in each file and include the License file
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * If applicable, add the following below the CDDL Header,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * with the fields enclosed by brackets [] replaced by
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * your own identifying information:
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * "Portions Copyrighted [year] [name of copyright owner]"
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * $Id: HomeDirLocator.java,v 1.2 2008/06/25 05:52:21 qcheng Exp $
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpackage com.sun.identity.agents.tools.weblogic.v10;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.configurator.IStateAccess;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.configurator.InstallException;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.configurator.IServerHomeDirLocator;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.FileUtils;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.LocalizedMessage;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperimport com.sun.identity.install.tools.util.Debug;
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Home directory locator for WL10 agent
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpublic class HomeDirLocator implements IServerHomeDirLocator,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper public String getServerDirectory(IStateAccess state)
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String startupScr = (String)state.get(STR_KEY_WL_STARTUP_SCRIPT);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String wlHomeDir = (new File(startupScr)).getParent();
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper if ((wlHomeDir != null) && (wlHomeDir.length() > 0)) {
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("HomeDirLocator: The server home " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper serverHomeDir + ", directory specified is invalid:");
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper LocalizedMessage.get(LOC_WL_ERR_IN_VALID_HOME_DIR,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("HomeDirLocator : WebLogic server home " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Localized constants
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper public static String LOC_WL_ERR_IN_VALID_HOME_DIR =
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper "WL_ERR_IN_VALID_HOME_DIR";