2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * The contents of this file are subject to the terms
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * of the Common Development and Distribution License
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * (the License). You may not use this file except in
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * compliance with the License.
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * You can obtain a copy of the License at
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * https://opensso.dev.java.net/public/CDDLv1.0.html or
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * See the License for the specific language governing
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * permission and limitations under the License.
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * When distributing Covered Code, include this CDDL
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * Header Notice in each file and include the License file
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * If applicable, add the following below the CDDL Header,
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * with the fields enclosed by brackets [] replaced by
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * your own identifying information:
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * "Portions Copyrighted [year] [name of copyright owner]"
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * $Id: HomeDirLocator.java,v 1.1 2009/01/21 18:43:54 kanduls Exp $
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperpackage com.sun.identity.agents.tools.jetty.v61;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.configurator.IServerHomeDirLocator;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.configurator.IStateAccess;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.configurator.InstallException;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.util.Debug;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.util.FileUtils;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperimport com.sun.identity.install.tools.util.LocalizedMessage;
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * Home directory locator for Jetty agent
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeperpublic class HomeDirLocator implements IServerHomeDirLocator, IConstants,
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * Computes the jetty home directory from the config directory
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * @param state State object where are the
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * @return Home directory.
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper * @throws InstallException
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper public String getServerDirectory(IStateAccess state)
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper Debug.log("HomeDirLocator: Finding home directory from config dir.");
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper if ((jettyConfigDir != null) && (jettyConfigDir.length() > 0)) {
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper jettyHomeDir = (new File(jettyConfigDir)).getParent();
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper "HomeDirLocator: The Jetty home directory "
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper LocalizedMessage.get(JETTY_ERR_IN_VALID_HOME_DIR,
2be3e935b5cdea10ddcaf8afff4790d7ce09e950Mark de Reeper "HomeDirLocator : Jetty server home " + "directory = "