Ignore:
Timestamp:
2016-11-02T21:34:47+13:00 (7 years ago)
Author:
davidb
Message:

More careful treatment of what to do when a JSON file isn't there

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest/src/main/java/org/hathitrust/extractedfeatures/JSONClusterFileIO.java

    r30996 r31045  
    99    protected static JSONObject readJSONFile(String filename)
    1010    {
    11         StringBuilder sb = new StringBuilder();
    12    
     11        JSONObject json_obj = null;
     12           
    1313        try {
    14    
     14            StringBuilder sb = new StringBuilder();
     15           
    1516            String str;
    1617            BufferedReader br = ClusterFileIO.getBufferedReaderForCompressedFile(filename);
     
    2021   
    2122            br.close();
     23           
     24            json_obj = new JSONObject(sb.toString());
    2225        }
    2326        catch (Exception e) {
    2427            e.printStackTrace();
    2528        }
    26    
    27         JSONObject json_obj = new JSONObject(sb.toString());
    28        
    2929       
    3030        return json_obj;
Note: See TracChangeset for help on using the changeset viewer.