1 package SOFA.Connector.EEG.EEM.Actions; 2 3 import SOFA.Connector.EEG.EEM.ActionException; 4 import SOFA.Connector.EEG.EEM.ActionInterface; 5 6 11 public class Cat implements ActionInterface { 12 public Cat(java.util.HashMap props) { 13 } 14 15 public String getName() { 16 return "cat"; 17 } 18 19 public void perform(SOFA.Connector.Property[] params, String sourceDir, String sourcePackage, String destDir, String destPackage) throws ActionException { 20 String outFile = null, types = null, classFile = null; 21 if ((outFile = SOFA.Connector.Property.findFirst(params,"resolverFile")) == null) { 22 throw new ActionException("\"resolverFile\" param not specified"); 23 } 24 if ((types = SOFA.Connector.Property.findFirst(params,"types")) == null) { 25 throw new ActionException("\"types\" param not specified"); 26 } 27 if ((classFile = SOFA.Connector.Property.findFirst(params,"classFile")) == null) { 28 throw new ActionException("\"classFile\" param not specified"); 29 } 30 try { 31 java.io.FileWriter fw = new java.io.FileWriter (outFile, true); String rrr = java.io.File.separator; 33 if (java.io.File.separator.equals("\\")) { 34 rrr = java.io.File.separator + java.io.File.separator; 35 } 36 fw.write(destDir+java.io.File.separator+classFile+" "+destPackage.replaceAll("\\.",rrr)+java.io.File.separator+classFile+" "+types+"\n"); 37 fw.close(); 38 } catch (java.io.IOException e) { 39 throw new ActionException("Cannot write type info of \""+classFile+"\".", e); 40 } 41 } 42 } 43 | Popular Tags |