1 package org.objectweb.petals.jbi.management.deployment.undeploy;2 3 import java.io.File ;4 import java.util.HashMap ;5 6 import org.apache.commons.io.FileUtils;7 import org.objectweb.petals.jbi.management.deployment.DeploymentContextConstants;8 import org.objectweb.petals.jbi.management.deployment.DeploymentUtils;9 import org.objectweb.petals.jbi.management.deployment.ServiceAssemblyDataHandler;10 import org.objectweb.petals.processor.Task;11 12 public class DeleteArchiveFromInstalledDirTask implements Task {13 14 public void execute(HashMap context) throws Exception {15 ServiceAssemblyDataHandler handler = (ServiceAssemblyDataHandler) context16 .get(DeploymentContextConstants.SA_DATA_HANDLER);17 18 File file = DeploymentUtils.getArchiveFile(handler.getArchiveURI());19 File installedArchive = DeploymentUtils.getInstalledArchive(file);20 if (installedArchive.exists()) {21 FileUtils.forceDelete(installedArchive);22 }23 }24 25 public void undo(HashMap context) throws Exception {26 // Nothing to do27 28 }29 30 }31