1 23 package org.enhydra.kelp.common.dods; 24 25 import org.enhydra.dods.xslt.*; 26 27 import java.io.*; 28 29 30 public class DodsThread extends Thread { 31 32 Generator gen = null; 33 34 public DodsThread(Generator g) { 35 gen = g; 36 } 37 38 39 public void run() { 40 try { 41 42 String javaPath = System.getProperty("javaPath"); 43 String enhydraPath = System.getProperty("enhydraPath"); 44 String s[] = new String [10]; 45 s[0] = javaPath+"/bin/java"; 46 s[1] = "-classpath"; 47 62 s[2] = ".;"+ enhydraPath+"/dods/lib/ejen.jar;"+ 64 enhydraPath+"/lib/core.jar;"+ 66 enhydraPath+"/lib/util.jar;"+ 67 enhydraPath+"/lib/enhydra.jar;"+ 68 enhydraPath+"/lib/gnu-regexp.jar;"+ 69 enhydraPath+"/lib/xercesImpl.jar;"+ 70 enhydraPath+"/lib/xml-apis.jar;"+ 71 javaPath+"/jre/lib/rt.jar;"+ 72 javaPath+"/lib/tools.jar;"+ 73 enhydraPath+"/dods/lib/dods.jar;"+ 74 enhydraPath+"/build/ant.jar;"+ 75 enhydraPath+"/build/anttask.jar"; 76 s[3] = "-DEJEN_HOME="+enhydraPath; 77 s[4] = "-DPROJECT_ROOT="+System.getProperty("projectRoot"); 78 s[5] = "-DDOML_FILE="+System.getProperty("domlFilePath"); 79 s[6] = "org.apache.tools.ant.Main"; 80 s[7] = "-f"; 81 s[8] = "C:/enhydra5/dods/generate.xml"; 82 s[9] = System.getProperty("dodsParameters"); 83 84 Process process = Runtime.getRuntime().exec(s); 85 86 java.io.InputStream inputstream = process.getInputStream(); 87 BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream)); 88 java.io.InputStream inputstream1 = process.getErrorStream(); 89 BufferedReader bufferedreader1 = new BufferedReader(new InputStreamReader(inputstream1)); 90 91 String s1=""; 92 String s2=""; 93 94 while(((s1 = bufferedreader.readLine()) != null)|| 95 ((s2 = bufferedreader1.readLine()) != null)) { 96 if (s1.indexOf("Processing") == -1) 97 if(!s1.equals("")) 98 gen.echo(s1); 99 if (s2.indexOf("Processing") == -1) 100 if(!s2.equals("")) 101 gen.echo(s2); 102 } 103 104 process.waitFor(); 105 int k = process.exitValue(); 106 107 } catch (Exception e) { 108 gen.echo("U threadu: error"+e); 109 110 } 111 } 112 } | Popular Tags |