Changeset 6804
- Timestamp:
- 11/13/15 15:19:58 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/PostProcessorsWithVocabularyMap.java
r6793 r6804 61 61 62 62 63 _logger.info("Reading vocabulary file from: {}", mapUrl); 64 // load records from file 65 // in the future this should be loaded from CLAVAS directly and the 66 // file only used as fallback 63 InputStream is = null; 64 File mapUrlFile = new File(mapUrl); 65 _logger.info("Reading vocabulary file from: {}", mapUrl); 66 // load records from file 67 // in the future this should be loaded from CLAVAS directly and the 68 // file only used as fallback 69 70 71 //try from file and if not exists fetch it from classpath (root of the vlo-vocabularies project) 72 Path p = Paths.get(mapUrl); 73 74 try { 75 is = new FileInputStream(mapUrlFile); 76 } catch (Exception e) { 77 _logger.warn("File {} not found, trying to fetch it from classpath ...", mapUrl); 67 78 68 InputStream is = PostProcessorsWithVocabularyMap.class.getClassLoader().getResourceAsStream(mapUrl);79 is = PostProcessorsWithVocabularyMap.class.getClassLoader().getResourceAsStream(mapUrlFile.getName()); 69 80 if(is == null) 70 81 throw new RuntimeException("Cannot instantiate postProcessor, " + mapUrl + " is not on the classpath"); 71 72 try{ 73 return VariantsMapMarshaller.unmarshal(is); 74 } catch (Exception e) { 75 throw new RuntimeException("Cannot instantiate postProcessor: ", e); 76 } 82 } 83 84 try{ 85 return VariantsMapMarshaller.unmarshal(is); 86 } catch (Exception e) { 87 throw new RuntimeException("Cannot instantiate postProcessor: ", e); 88 } 77 89 78 90
Note: See TracChangeset
for help on using the changeset viewer.