- Timestamp:
- 2017-07-05T20:43:44+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone/Plugins.java
r31641 r31776 165 165 // Create the process. 166 166 SafeProcess process = new SafeProcess((String[]) args.toArray(new String[] { })); 167 process.setSplitStdErrorNewLines(true); 167 168 168 169 // run the SafeProcess … … 174 175 // get the result: We expect XML to have come out of the process std error stream. 175 176 pluginfo_xml = process.getStdError(); 177 // make sure to have parsed out any lines preceding the XML content 178 pluginfo_xml = XMLTools.readXMLStream(pluginfo_xml).toString(); 176 179 ///System.err.println("*********\nPluginInfo, got:\n" + pluginfo_xml + "\n**********\n"); 177 180 } … … 236 239 args.add("-listall"); 237 240 args.add("-xml"); 238 241 239 242 // Run the pluginfo.pl process: 240 243 // Create the process. 241 244 SafeProcess process = new SafeProcess((String[]) args.toArray(new String[] { })); 245 process.setSplitStdErrorNewLines(true); 242 246 243 247 // run the SafeProcess … … 249 253 // get the result: We expect XML to have come out of the process std error stream. 250 254 xml = process.getStdError(); 251 255 // make sure to parse out any lines before the XML content, else running "gli -debug" results in an XML error: 252 256 // for pluginfo.pl -listall, we see a "AutoloadConverters" (PDFBox) message 253 // before actual XML output, which breaks XML parsing. Get rid of output before "<?xml" 254 int startIndex = xml.indexOf("<?xml"); 255 if(startIndex != 0) { 256 xml = xml.substring(startIndex); 257 } 257 // before actual XML output, which breaks XML parsing. 258 // This gets rid of output before "<?xml" in the way that the code did before the change to SafeProcess 259 // Then we can call the same from method RemoteGreenstoneServer.java, so that running "client-gli -debug" 260 // will work too. 261 xml = XMLTools.readXMLStream(xml).toString(); 262 258 263 ///System.err.println("*********\nPluginsList, got:\n" + xml + "\n**********\n"); 259 264 }
Note:
See TracChangeset
for help on using the changeset viewer.