CopyAgentFilesTask.java revision a5b4af20981ceecfbdf0186421baba60094635b3
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Copyright (c) 2010-2015 ForgeRock AS. All Rights Reserved
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * The contents of this file are subject to the terms
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * of the Common Development and Distribution License
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * (the License). You may not use this file except in
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * compliance with the License.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * You can obtain a copy of the License at
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * http://forgerock.org/license/CDDLv1.0.html
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * See the License for the specific language governing
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * permission and limitations under the License.
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * When distributing Covered Code, include this CDDL
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * Header Notice in each file and include the License file
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * at http://forgerock.org/license/CDDLv1.0.html
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * If applicable, add the following below the CDDL Header,
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * with the fields enclosed by brackets [] replaced by
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * your own identifying information:
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * "Portions Copyrighted [year] [name of copyright owner]"
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellpackage com.sun.identity.agents.tools.tomcat.v6;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.configurator.IStateAccess;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.configurator.ITask;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.configurator.InstallException;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.util.ConfigUtil;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.util.Debug;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.util.LocalizedMessage;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellimport com.sun.identity.install.tools.util.FileUtils;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell * @author Steve Ferris steve.ferris@forgerock.com
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnellpublic class CopyAgentFilesTask extends AgentFilesBase implements ITask {
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell public static final String LOC_TSK_MSG_COPY_AGENT_FILES_SCRIPT_EXECUTE
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell = "TSK_MSG_COPY_AGENT_FILES_SCRIPT_EXECUTE";
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell public static final String LOC_TSK_MSG_COPY_AGENT_FILES_SCRIPT_ROLLBACK
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell = "TSK_MSG_COPY_AGENT_FILES_ROLLBACK";
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell public boolean execute(String name, IStateAccess stateAccess, Map properties)
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell boolean status = true;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell Debug.log("CopyAgentFilesTask.execute() - encountered exception " +
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell private boolean copyAgentJarFiles() {
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell boolean status = true;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell String destDir = _catalinaHomeDir + STR_FORWARD_SLASH + STR_TOMCAT_COMMON_LIB;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell for (int i = 0; i < libJarFiles.length; i++) {
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell FileUtils.copyJarFile(srcDir, destDir, libJarFiles[i]);
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell Debug.log("CopyAgentFilesTask.copyAgentJarFiles() - copy " +
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell libJarFiles[i] + " from " + srcDir + " to " + destDir);
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell Debug.log("CopyAgentFilesTask.copyAgentJarFiles() - " +
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell "Error occured while copying jar files from " + srcDir +
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell private boolean copyAgentLocaleFiles() {
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell boolean status = true;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell String destDir = _catalinaHomeDir + STR_FORWARD_SLASH + STR_TOMCAT_COMMON_LIB;
3fc1b5e9b2ff286cd528a06154cc998198de1e70Craig McDonnell for (File localeFile : listAgentLocaleFiles()) {
status = false;
return status;
private boolean copyAgentAppWarFile() {
boolean status = true;
} catch (Exception e) {
status = false;
return status;
return message;
return message;
boolean status = false;
return status;