Changeset 6992
- Timestamp:
- 2004-03-09T16:22:47+13:00 (20 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer/cdm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r6861 r6992 304 304 * @param classifier The classifier <strong>File</strong> you wish to load. 305 305 */ 306 private void loadClassifier(File classifier ) {306 private void loadClassifier(File classifier, String lang) { 307 307 ///ystem.err.println("Attempting to parse " + classifier.toString()); 308 308 Document document = null; … … 313 313 String args[] = null; 314 314 if(Utility.isWindows()) { 315 args = new String[ 4];315 args = new String[6]; 316 316 if(Gatherer.config.perl_path != null) { 317 317 args[0] = Gatherer.config.perl_path; … … 322 322 args[1] = Gatherer.config.gsdl_path + "bin" + File.separator + "script" + File.separator + "classinfo.pl"; 323 323 args[2] = "-xml"; 324 args[3] = getClassifierName(classifier); 324 args[3] = "-language"; 325 args[4] = lang; 326 args[5] = getClassifierName(classifier); 325 327 } 326 328 else { 327 args = new String[ 3];329 args = new String[5]; 328 330 args[0] = "classinfo.pl"; 329 331 args[1] = "-xml"; 330 args[2] = getClassifierName(classifier); 332 args[2] = "-language"; 333 args[3] = lang; 334 args[4] = getClassifierName(classifier); 331 335 } 332 336 … … 334 338 Runtime runtime = Runtime.getRuntime(); 335 339 Process process = runtime.exec(args); 336 BufferedReader error_in = new BufferedReader(new InputStreamReader(process.getErrorStream() ));340 BufferedReader error_in = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8")); 337 341 String line = ""; 338 342 StringBuffer xml = new StringBuffer(""); … … 395 399 String directory = Gatherer.config.gsdl_path; 396 400 directory = directory + "perllib" + File.separator + "classify" + File.separator; 401 String current_lang = Gatherer.config.getLanguage(); 397 402 File files[] = (new File(directory)).listFiles(); 398 403 if(files != null) { … … 402 407 // We only want to check Perl Modules. 403 408 if(files[i].getName().endsWith(".pm")) { 404 loadClassifier(files[i] );409 loadClassifier(files[i], current_lang); 405 410 } 406 411 progress.inc(); -
trunk/gli/src/org/greenstone/gatherer/cdm/PlugInManager.java
r6862 r6992 354 354 * @param plugin The plugin <strong>File</strong> you wish to load. 355 355 */ 356 private void loadPlugIn(File plugin ) {356 private void loadPlugIn(File plugin, String lang) { 357 357 Document document = null; 358 358 359 // Run pluginfo on this plugin, and then send the results for parsing. 359 360 try { 360 361 String args[] = null; 361 362 if(Utility.isWindows()) { 362 args = new String[ 4];363 args = new String[6]; 363 364 if(Gatherer.config.perl_path != null) { 364 365 args[0] = Gatherer.config.perl_path; … … 369 370 args[1] = Gatherer.config.gsdl_path + "bin" + File.separator + "script" + File.separator + "pluginfo.pl"; 370 371 args[2] = "-xml"; 371 args[3] = getPlugInName(plugin); 372 args[3] = "-language"; 373 args[4] = lang; 374 args[5] = getPlugInName(plugin); 372 375 } 373 376 else { 374 args = new String[ 3];377 args = new String[5]; 375 378 args[0] = "pluginfo.pl"; 376 379 args[1] = "-xml"; 377 args[2] = getPlugInName(plugin); 380 args[2] = "-language"; 381 args[3] = lang; 382 args[4] = getPlugInName(plugin); 378 383 } 379 384 // Create the process. … … 381 386 Process process = runtime.exec(args); 382 387 //InputStream input_stream = process.getErrorStream(); 383 BufferedReader error_in = new BufferedReader(new InputStreamReader(process.getErrorStream() ));388 BufferedReader error_in = new BufferedReader(new InputStreamReader(process.getErrorStream(), "UTF-8")); 384 389 String line = ""; 385 390 StringBuffer xml = new StringBuffer(""); … … 453 458 boolean is_windows = Utility.isWindows(); 454 459 boolean is_mac = Utility.isMac(); 460 String current_lang = Gatherer.config.getLanguage(); 455 461 if(files != null) { 456 462 // Create a progress indicator. … … 462 468 // don't load DBPlug for windows 463 469 } else { 464 loadPlugIn(files[i] );470 loadPlugIn(files[i], current_lang); 465 471 } 466 472 }
Note:
See TracChangeset
for help on using the changeset viewer.