@Test public void initCache4() throws IOException { DOIResolverCache doiResolverCache = new DOIResolverCache("/org/eol/globi/tool/citations.tsv.gz"); doiResolverCache.setCacheDir(cacheDir); String ref1 = "Kalka, Margareta, and Elisabeth K. V. Kalko. Gleaning Bats as Underestimated Predators of Herbivorous Insects: Diet of Micronycteris Microtis (Phyllostomidae) in Panama. Journal of Tropical Ecology 1 (2006): 1-10."; Map<String, DOI> doiForReference = doiResolverCache.resolveDoiFor(Collections.singletonList(ref1)); assertThat(doiForReference.get(ref1), is(new DOI("1017", "S0266467405002920"))); }
@Override public Map<String, DOI> resolveDoiFor(Collection<String> references) throws IOException { Map<String, DOI> results = new TreeMap<>(); for (String reference : references) { DOI doi = getDoiCitationMap().get(reference); if (doi != null) { results.put(reference, doi); } } return results; }
DOIResolverCache extends CacheService implements DOIResolver { @Override public Map<String, DOI> resolveDoiFor(Collection<String> references) throws IOException { Map<String, DOI> results = new TreeMap<>(); for (String reference : references) { DOI doi = getDoiCitationMap().get(reference); if (doi != null) { results.put(reference, doi); } } return results; } }
DOIResolverCache extends CacheService implements DOIResolver { @Override public Map<String, DOI> resolveDoiFor(Collection<String> references) throws IOException { Map<String, DOI> results = new TreeMap<>(); for (String reference : references) { DOI doi = getDoiCitationMap().get(reference); if (doi != null) { results.put(reference, doi); } } return results; } DOIResolverCache();  DOIResolverCache(String doiCacheResource); }
DOIResolverCache extends CacheService implements DOIResolver { @Override public Map<String, DOI> resolveDoiFor(Collection<String> references) throws IOException { Map<String, DOI> results = new TreeMap<>(); for (String reference : references) { DOI doi = getDoiCitationMap().get(reference); if (doi != null) { results.put(reference, doi); } } return results; } DOIResolverCache();  DOIResolverCache(String doiCacheResource); @Override Map<String, DOI> resolveDoiFor(Collection<String> references); Map<String, DOI> getDoiCitationMap(); @Override DOI resolveDoiFor(final String reference); void init(final Reader reader); }
DOIResolverCache extends CacheService implements DOIResolver { @Override public Map<String, DOI> resolveDoiFor(Collection<String> references) throws IOException { Map<String, DOI> results = new TreeMap<>(); for (String reference : references) { DOI doi = getDoiCitationMap().get(reference); if (doi != null) { results.put(reference, doi); } } return results; } DOIResolverCache();  DOIResolverCache(String doiCacheResource); @Override Map<String, DOI> resolveDoiFor(Collection<String> references); Map<String, DOI> getDoiCitationMap(); @Override DOI resolveDoiFor(final String reference); void init(final Reader reader);  }