- Timestamp:
- 2017-04-21T21:09:08+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone/Plugins.java
r26225 r31636 37 37 import org.greenstone.gatherer.cdm.Plugin; 38 38 import org.greenstone.gatherer.remote.RemoteGreenstoneServer; 39 import org.greenstone.gatherer.util.SafeProcess; 39 40 import org.greenstone.gatherer.util.StaticStrings; 40 41 import org.greenstone.gatherer.util.Utility; … … 160 161 args.add(Configuration.getLanguage()); 161 162 args.add(plugin.getName()); 162 // Run the pluginfo.pl process 163 Runtime runtime = Runtime.getRuntime(); 164 Process process = runtime.exec((String[]) args.toArray(new String[] { })); 165 InputStream input_stream = process.getErrorStream(); 166 StringBuffer pluginfo_xml_buffer = XMLTools.readXMLStream(input_stream); 167 if (pluginfo_xml_buffer != null) { 168 pluginfo_xml = pluginfo_xml_buffer.toString(); 169 } 163 164 // Run the pluginfo.pl process: 165 // Create the process. 166 SafeProcess process = new SafeProcess((String[]) args.toArray(new String[] { })); 167 168 // run the SafeProcess 169 int exitVal = process.runProcess(); 170 if(exitVal != 0) { 171 throw new Exception("*** Error running pluginfo.pl loadPlugInfo, process exited with: " 172 + exitVal); 173 } 174 // get the result: We expect XML to have come out of the process std error stream. 175 pluginfo_xml = process.getStdError(); 176 ///System.err.println("*********\nPluginInfo, got:\n" + pluginfo_xml + "\n**********\n"); 170 177 } 171 178 … … 230 237 args.add("-xml"); 231 238 232 // Run the pluginfo.pl process 233 Runtime runtime = Runtime.getRuntime(); 234 Process process = runtime.exec((String[]) args.toArray(new String[] { })); 235 InputStream input_stream = process.getErrorStream(); 236 xml = XMLTools.readXMLStream(input_stream); 239 // Run the pluginfo.pl process: 240 // Create the process. 241 SafeProcess process = new SafeProcess((String[]) args.toArray(new String[] { })); 242 243 // run the SafeProcess 244 int exitVal = process.runProcess(); 245 if(exitVal != 0) { 246 throw new Exception("*** Error running pluginfo.pl loadPluginsList, process exited with: " 247 + exitVal); 248 } 249 // get the result: We expect XML to have come out of the process std error stream. 250 xml = new StringBuffer(process.getStdError()); 251 ///System.err.println("*********\nPluginsList, got:\n" + xml + "\n**********\n"); 237 252 } 238 253
Note:
See TracChangeset
for help on using the changeset viewer.