Example #1
0
 public void loadMappings() throws XMLStreamException, FactoryConfigurationError {
   Map<Integer, List<Mapping>> grs = downloader.downloadAllMappings();
   Map<Provider, TargetIdExtractor> extractors = constructExtractors(grs);
   for (Map.Entry<Integer, List<Mapping>> mappingList : grs.entrySet()) {
     mappingHandler.handleMappings(
         mappingList.getKey().longValue(), mappingList.getValue(), extractors);
   }
   mappingHandler.endLoading();
 }
Example #2
0
 protected void checkEmailWasSet() {
   Properties p = new Properties();
   try {
     p.load(this.getClass().getClassLoader().getResourceAsStream("grsloader.default.properties"));
     String defaultEmail;
     if ((defaultEmail = p.getProperty("grs.email")) != null) {
       if (downloader.getEmail().equalsIgnoreCase(defaultEmail)) {
         logger.debug("Set email is equal to default {}", defaultEmail);
         throw new RuntimeException("Error: you need to set an email address (-Dgrs.email=...)");
       }
     } else {
       throw new RuntimeException("Error: property grs.email is not defined.");
     }
   } catch (IOException e) {
     throw new RuntimeException("Could not find default properties file.", e);
   }
 }