KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > Connector > EEG > EEM > Actions > Install


1 /*
2  * Install.java
3  *
4  * Created on 2. duben 2002, 23:37
5  */

6
7 package SOFA.Connector.EEG.EEM.Actions;
8
9 import SOFA.Connector.EEG.EEM.ActionException;
10 import SOFA.Connector.EEG.EEM.ActionInterface;
11
12 /**
13  *
14  * @author ghort
15  * @version
16  */

17 public class Install implements ActionInterface {
18
19     /** Creates new Install */
20    public Install(java.util.HashMap JavaDoc props) {
21    }
22
23     public String JavaDoc getName() {
24         return "install";
25     }
26      
27     public void perform(SOFA.Connector.Property[] params, String JavaDoc sourceDir, String JavaDoc sourcePackage, String JavaDoc destDir, String JavaDoc destPackage) throws ActionException {
28          String JavaDoc source, dest;
29          if ((source=SOFA.Connector.Property.findFirst(params,"source"))==null) {
30              throw new ActionException("Source param not specified");
31          }
32          if ((dest=SOFA.Connector.Property.findFirst(params,"destination"))==null) {
33              throw new ActionException("Destination param not specified");
34          }
35          
36          try {
37              SOFA.Connector.EEG.fileutil.Copy.copy(new java.io.File JavaDoc(destDir,dest),new java.io.File JavaDoc(sourceDir,source));
38          } catch (Exception JavaDoc e) {
39              throw new ActionException("Can't copy "+sourceDir+":"+source+" -> "+destDir+":"+dest+".",e);
40          }
41     }
42      
43 }
44
Popular Tags