1 21 22 23 package org.webdocwf.util.loader.wizard; 24 25 import java.io.*; 26 27 32 public class OctopusLoader { 33 protected WizardFrame wizard = null; 34 private OctopusLoaderData initData; 35 36 40 public OctopusLoader(OctopusLoaderData initData) { 41 this.initData=initData; 42 } 43 44 49 public String [] generateAll() throws Exception { 50 int exit = 0; 51 Process process = null; 52 String tmp[] = new String [27]; 53 String as[]=null; 54 try{ 55 ErrorReader errorReader; 56 BufferedReader buffer; 57 BufferedReader error; 58 String s; 59 int param = 0; 60 61 if (!initData.getLogMode().equalsIgnoreCase("")) { 62 tmp[param] = "-m"; 63 param++; 64 tmp[param] = initData.getLogMode(); 65 param++; 66 } 67 if (!initData.getLogFileDir().equalsIgnoreCase("")) { 68 tmp[param] = "-l"; 69 param++; 70 tmp[param] = initData.getLogFileDir(); 71 param++; 72 } 73 if (!initData.getLogFileName().equalsIgnoreCase("")) { 74 tmp[param] = "-f"; 75 param++; 76 tmp[param] = initData.getLogFileName(); 77 param++; 78 } 79 if (!initData.getRestartIndicator().equalsIgnoreCase("")) { 80 tmp[param] = "-r"; 81 param++; 82 tmp[param] = initData.getRestartIndicator(); 83 param++; 84 } 85 if (!initData.getUserId().equalsIgnoreCase("")) { 86 tmp[param] = "-u"; 87 param++; 88 tmp[param] = initData.getUserId(); 89 param++; 90 } 91 92 if (!initData.getVariables().equalsIgnoreCase("")) { 93 tmp[param] = "-v"; 94 param++; 95 tmp[param] = initData.getVariables(); 96 param++; 97 } 98 if (!initData.getVendorConf().equalsIgnoreCase("")) { 99 tmp[param] = "-d"; 100 param++; 101 tmp[param] = initData.getVendorConf(); 102 param++; 103 } 104 if (!initData.getOnErrorCon().equalsIgnoreCase("")) { 105 tmp[param] = "-e"; 106 param++; 107 tmp[param] = initData.getOnErrorCon(); 108 param++; 109 } 110 111 if (!initData.getAdditionalPaths().equalsIgnoreCase("")) { 112 tmp[param] = "-p"; 113 param++; 114 tmp[param] = initData.getAdditionalPaths(); 115 param++; 116 } 117 118 if (!initData.getCommitCount().equalsIgnoreCase("")) { 119 tmp[param] = "-c"; 120 param++; 121 tmp[param] = initData.getCommitCount(); 122 param++; 123 } 124 if (!initData.getReturnCode().equalsIgnoreCase("")) { 125 tmp[param] = "-rc"; 126 param++; 127 tmp[param] = initData.getReturnCode(); 128 param++; 129 } 130 if (!initData.getIncludeTables().equalsIgnoreCase("")) { 131 tmp[param] = "-it"; 132 param++; 133 tmp[param] = initData.getIncludeTables(); 134 param++; 135 } 136 if (!initData.getConfJarStructure().equalsIgnoreCase("")) { 137 tmp[param] = "-cjs"; 138 param++; 139 tmp[param] = initData.getConfJarStructure(); 140 param++; 141 } 142 if (!initData.getPathToXml().equalsIgnoreCase("")) { 143 tmp[param] = " "; 144 param++; 145 tmp[param] = initData.getPathToXml(); 146 param++; 147 } 148 149 150 as=new String [param]; 151 for (int i=0;i<param;i++){ 152 if(!tmp[i].equalsIgnoreCase("null")) 153 as[i] = tmp[i]; 154 } 155 } catch (Exception e) { 156 e.printStackTrace(); 157 System.out.println(e.getMessage()); 158 throw new Exception (e.getMessage()); 159 } 160 return as; 161 } 162 163 } | Popular Tags |