Changeset 34295

Show
Ignore:
Timestamp:
27.07.2020 16:19:39 (8 days ago)
Author:
ak19
Message:

To be compatible with a VM that generates nightly binaries using Java 6, need to change GLI src to use Java 6 version of Commons CSV library, which did not have certain methods present in the Commons CSV for Java 8.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataToCSV.java

    r34294 r34295  
    387387        } 
    388388 
    389         printer.close(true); // flush and close 
     389        //printer.close(true); // flush and close, only from Java 7/8 version of commons-csv 
     390        printer.close();         
    390391         
    391392    } catch (IOException ex) { 
     
    431432        //String[] metaFieldNames = lenientCSVFormat.getHeader(); // didn't work 
    432433        // getHeaders() returns List<String>, convert to String[] array 
    433         String[] metaFieldNames = parser.getHeaderNames().toArray(new String[0]); 
     434         
     435        //String[] metaFieldNames = parser.getHeaderNames().toArray(new String[0]); // not available in Java-6 release of Commons-CSV 
     436        String[] metaFieldNames = parser.getHeaderMap().keySet().toArray(new String[0]); 
    434437        
    435438        for (CSVRecord record : parser) {