KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > jbi > management > deployment > undeploy > DeleteArchiveFromInstalledDirTask


1 package org.objectweb.petals.jbi.management.deployment.undeploy;
2
3 import java.io.File JavaDoc;
4 import java.util.HashMap JavaDoc;
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 JavaDoc context) throws Exception JavaDoc {
15         ServiceAssemblyDataHandler handler = (ServiceAssemblyDataHandler) context
16                 .get(DeploymentContextConstants.SA_DATA_HANDLER);
17
18         File JavaDoc file = DeploymentUtils.getArchiveFile(handler.getArchiveURI());
19         File JavaDoc installedArchive = DeploymentUtils.getInstalledArchive(file);
20         if (installedArchive.exists()) {
21             FileUtils.forceDelete(installedArchive);
22         }
23     }
24
25     public void undo(HashMap JavaDoc context) throws Exception JavaDoc {
26         // Nothing to do
27

28     }
29
30 }
31
Popular Tags