Changeset 18729


Ignore:
Timestamp:
03/20/09 17:15:36 (12 years ago)
Author:
ak19
Message:

Dr Bainbridge made some corrections in here in the run() method, such as closing the stream reader, and reorganising the code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/server/RunTarget.java

    r18558 r18729  
    3636         BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
    3737         String line = null;
    38              while (!(line = br.readLine()).startsWith(targetFinished)){
    39                  
     38             
     39         while ((line = br.readLine()) != null) {
     40
     41         logger.info(line);
     42
    4043         if (line.equals(targetSuccess)){
    4144             state = 0;
    4245         }
    43    
     46       
    4447         if (line.equals(targetFailed)){
    4548             state = 1;
    46                   }
    47          logger.info(line);
    48          }   
     49         }
     50
     51         if(line.startsWith(targetFinished)){
     52             break;     
     53         }
     54         }
     55         
     56         br.close();
     57
     58         if(state < 0) {
     59         logger.info("Unexpected end of input when running target: " + targetCmd);
     60         }
    4961     } catch (Exception e) {
    5062         e.printStackTrace();
Note: See TracChangeset for help on using the changeset viewer.