1 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 17 public class Install implements ActionInterface { 18 19 20 public Install(java.util.HashMap props) { 21 } 22 23 public String getName() { 24 return "install"; 25 } 26 27 public void perform(SOFA.Connector.Property[] params, String sourceDir, String sourcePackage, String destDir, String destPackage) throws ActionException { 28 String 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 (destDir,dest),new java.io.File (sourceDir,source)); 38 } catch (Exception e) { 39 throw new ActionException("Can't copy "+sourceDir+":"+source+" -> "+destDir+":"+dest+".",e); 40 } 41 } 42 43 } 44 | Popular Tags |