Changeset 6533
- Timestamp:
- 09/22/15 08:53:38 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.3-oeaw/vlo-vocabularies/src/main/java/eu/clarin/cmdi/vlo/transformers/CSVTransformer.java
r6505 r6533 12 12 import java.util.ArrayList; 13 13 import java.util.Arrays; 14 import java.util.HashMap;15 14 import java.util.List; 16 15 import java.util.Map; … … 81 80 82 81 82 // public synchronized void csv2xml(String map) throws IOException, JAXBException{ 83 // _logger.info("reading from file {}{}.csv.", Constants.CSV_PATH, map); 84 // InputStream input = new FileInputStream(Constants.CSV_PATH + map + ".csv"); 85 // _logger.info("output will be saved into {}{}.xml.", Constants.MAPS_PATH, map); 86 // OutputStream output = new FileOutputStream(Constants.MAPS_PATH + map + ".xml"); 87 // 88 // csv2xml(input, output); 89 // 90 // input.close(); 91 // output.close(); 92 // } 93 94 83 95 public synchronized void csv2xml(String map) throws IOException, JAXBException{ 84 96 _logger.info("reading from file {}{}.csv.", Constants.CSV_PATH, map); 85 InputStream input = new FileInputStream(Constants.CSV_PATH + map + ".csv"); 97 InputStream input; 98 try{ 99 input = new FileInputStream(Constants.CSV_PATH + map + ".csv"); 100 }catch(FileNotFoundException e){ 101 _logger.error("Could not find the file " + Constants.CSV_PATH + map + ".csv", e); 102 _logger.info("trying with /" + Constants.CSV_PATH + map + ".csv"); 103 input = new FileInputStream("/" + Constants.CSV_PATH + map + ".csv"); 104 105 } 106 86 107 _logger.info("output will be saved into {}{}.xml.", Constants.MAPS_PATH, map); 87 108 OutputStream output = new FileOutputStream(Constants.MAPS_PATH + map + ".xml");
Note: See TracChangeset
for help on using the changeset viewer.