HomeDirLocator.java revision de47fb992b4c3414ac5b445d5cab364b0b8b8b43
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Copyright (c) 2008 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/11/21 22:21:43 leiming Exp $
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpackage com.sun.identity.agents.tools.websphere;
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 WAS agent
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeperpublic class HomeDirLocator implements IServerHomeDirLocator,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper public String getServerDirectory(IStateAccess state)
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String wasHomeDir = (String)state.get(STR_KEY_WAS_HOME_DIR);
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("HomeDirLocator: The server home " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper wasHomeDir + ", directory specified is invalid:");
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper LocalizedMessage.get(LOC_WAS_ERR_IN_VALID_HOME_DIR,
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper String libExtDir = wasHomeDir + STR_FILE_SEP + "lib" +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper // Will validate later
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper Debug.log("HomeDirLocator : WebSphere home " + "directory = " +
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper * Localized constants
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper public static String LOC_WAS_ERR_IN_VALID_HOME_DIR =
de47fb992b4c3414ac5b445d5cab364b0b8b8b43Mark de Reeper "WAS_ERR_IN_VALID_HOME_DIR";