Changeset 6773
- Timestamp:
- 11/09/15 16:05:52 (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
r6731 r6773 59 59 60 60 protected VariantsMap getMappingFromFile(String mapUrl) { 61 try {61 62 62 63 63 _logger.info("Reading vocabulary file from: {}", mapUrl); … … 65 65 // in the future this should be loaded from CLAVAS directly and the 66 66 // file only used as fallback 67 68 // InputStream is = 69 // PostProcessorsWithVocabularyMap.class.getClassLoader().getResourceAsStream(mapUrl); 70 InputStream is = new FileInputStream(new File(mapUrl)); 71 72 return VariantsMapMarshaller.unmarshal(is); 73 } catch (Exception e) { 74 throw new RuntimeException("Cannot instantiate postProcessor:", e); 75 } 67 68 69 //try from file first 70 try { 71 InputStream is = new FileInputStream(new File(mapUrl)); 72 } catch (Exception e) { 73 _logger.warn("File {} not found, trying to fetch it from classpath ...", mapUrl); 74 75 76 } 77 78 //try from classpath 79 80 InputStream is = PostProcessorsWithVocabularyMap.class.getClassLoader().getResourceAsStream(mapUrl); 81 if(is == null) 82 throw new RuntimeException("Cannot instantiate postProcessor, " + mapUrl + " is not on the classpath"); 83 84 try{ 85 return VariantsMapMarshaller.unmarshal(is); 86 } catch (Exception e) { 87 throw new RuntimeException("Cannot instantiate postProcessor: ", e); 88 } 89 90 76 91 } 77 92
Note: See TracChangeset
for help on using the changeset viewer.