Changeset 33924

Show
Ignore:
Timestamp:
14.02.2020 19:22:40 (4 days ago)
Author:
ak19
Message:

Adding in Dr Bainbridge's command to check the JSON generated is valid. The JSON generated was already valid, it only looked like it wasn't since I was still looking at SafeProcess?' command string output, as SafeProcess? ends up printing this debugging info twice in a row to stderr the way I've set up the logger for Atea stuff).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • other-projects/maori-lang-detection/src/org/greenstone/atea/SummaryTool.java

    r33919 r33924  
    55 
    66import org.apache.log4j.Logger; 
     7 
     8import org.greenstone.util.SafeProcess; 
    79 
    810/** 
     
    430432            System.err.println("Total count for query: " + mapData.getTotalCount()); 
    431433             
     434            // Running the command: 
     435            //    python -mjson.tool file.json 
     436            // to confirm if the JSON in the provided json file parses/is valid JSON. 
     437 
     438            String[] cmdArgs = {"python", "-mjson.tool", geoJsonFilename}; 
     439            SafeProcess p = new SafeProcess(cmdArgs); 
     440            int retVal = p.runProcess(); 
     441            logger.info("Json Validation tool returned with value: " + retVal); 
     442            logger.info("   std out: " + p.getStdOutput()); 
     443            logger.info("   std err: " + p.getStdError()); 
     444 
     445             
    432446            /*boolean uriEncoded = true; 
    433447            String mapDataEncodedStr = mapData.getFeaturesGeoJsonString(uriEncoded);