@Test public void imagesForNames() throws IOException { List<TaxonImage> images = imageService.findImagesForNames(new String[]{"Homo sapiens", "Ariopsis felis"}, "en"); assertThat(images.size(), is(2)); }
@RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public List<TaxonImage> findImagesForNames( @RequestParam(value = "name") String[] names, @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage) throws IOException { List<TaxonImage> images = new ArrayList<TaxonImage>(); for (String name : names) { TaxonImage image = findTaxonImagesForTaxonWithName(name, preferredLanguage); if (image != null) { images.add(image); } } return images; }
ImageService { @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public List<TaxonImage> findImagesForNames( @RequestParam(value = "name") String[] names, @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage) throws IOException { List<TaxonImage> images = new ArrayList<TaxonImage>(); for (String name : names) { TaxonImage image = findTaxonImagesForTaxonWithName(name, preferredLanguage); if (image != null) { images.add(image); } } return images; } }
ImageService { @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public List<TaxonImage> findImagesForNames( @RequestParam(value = "name") String[] names, @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage) throws IOException { List<TaxonImage> images = new ArrayList<TaxonImage>(); for (String name : names) { TaxonImage image = findTaxonImagesForTaxonWithName(name, preferredLanguage); if (image != null) { images.add(image); } } return images; }  }
ImageService { @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public List<TaxonImage> findImagesForNames( @RequestParam(value = "name") String[] names, @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage) throws IOException { List<TaxonImage> images = new ArrayList<TaxonImage>(); for (String name : names) { TaxonImage image = findTaxonImagesForTaxonWithName(name, preferredLanguage); if (image != null) { images.add(image); } } return images; }  @RequestMapping(value = "/imagesForName/{scientificName}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForTaxonWithName(
            @PathVariable("scientificName") String scientificName,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/imagesForName", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForTaxonWithName2(
            @RequestParam(value = "name", required = false) String[] names,
            @RequestParam(value = "externalId", required = false) String[] externalIds,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody List<TaxonImage> findImagesForNames(
            @RequestParam(value = "name") String[] names,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/images/{externalId}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForExternalId(
            @PathVariable("externalId") String externalId,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); }
ImageService { @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody public List<TaxonImage> findImagesForNames( @RequestParam(value = "name") String[] names, @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage) throws IOException { List<TaxonImage> images = new ArrayList<TaxonImage>(); for (String name : names) { TaxonImage image = findTaxonImagesForTaxonWithName(name, preferredLanguage); if (image != null) { images.add(image); } } return images; }  @RequestMapping(value = "/imagesForName/{scientificName}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForTaxonWithName(
            @PathVariable("scientificName") String scientificName,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/imagesForName", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForTaxonWithName2(
            @RequestParam(value = "name", required = false) String[] names,
            @RequestParam(value = "externalId", required = false) String[] externalIds,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/imagesForNames", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody List<TaxonImage> findImagesForNames(
            @RequestParam(value = "name") String[] names,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage); @RequestMapping(value = "/images/{externalId}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @ResponseBody TaxonImage findTaxonImagesForExternalId(
            @PathVariable("externalId") String externalId,
            @RequestParam(value = "lang", required = false, defaultValue = "en") String preferredLanguage);  }