Changeset 6541
- Timestamp:
- 09/22/15 09:58:16 (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
r6540 r6541 95 95 public synchronized void csv2xml(String map) throws IOException, JAXBException{ 96 96 _logger.info("Current directory: {}", System.getProperty("user.dir")); 97 _logger.info("reading from file {}{}.csv.", Constants.CSV_PATH, map); 98 InputStream input; 99 try{ 100 input = new FileInputStream(Constants.CSV_PATH + map + ".csv"); 101 }catch(FileNotFoundException e){ 102 _logger.error("Could not find the file " + Constants.CSV_PATH + map + ".csv", e); 103 _logger.info("trying with /" + Constants.CSV_PATH + map + ".csv"); 104 try{ 105 input = new FileInputStream("/" + Constants.CSV_PATH + map + ".csv"); 106 }catch(FileNotFoundException ex){ 107 _logger.error("Could not find the file /" + Constants.CSV_PATH + map + ".csv", e); 108 _logger.info("trying to fetch from classpath /" + Constants.CSV_PATH + map + ".csv"); 109 input = CSVTransformer.class.getResourceAsStream("/" + Constants.CSV_PATH + map + ".csv"); 110 } 111 112 113 } 114 115 _logger.info("output will be saved into {}{}.xml.", Constants.MAPS_PATH, map); 116 OutputStream output = new FileOutputStream(Constants.MAPS_PATH + map + ".xml"); 97 98 _logger.info("reading from file {}{}.csv.", Constants.CSV_PATH, map); 99 InputStream input = CSVTransformer.class.getResourceAsStream("/" + Constants.CSV_PATH + map + ".csv"); 100 101 _logger.info("output will be saved into {}{}.xml.", Constants.MAPS_PATH, map); 102 OutputStream output = CSVTransformer.class.getResource("/" + Constants.MAPS_PATH + map + ".xml").openConnection().getOutputStream(); 117 103 118 104 csv2xml(input, output);
Note: See TracChangeset
for help on using the changeset viewer.