@Override public DataAndUrl get(final List<String> urlStrings) { final int numberOfUrls = urlStrings.size(); int ii = 0; for (final String urlString : urlStrings) { try { ii++; final byte[] bytes = get(urlString); if (bytes == null) { continue; } return new DataAndUrl(bytes, urlString); } catch (Exception e) { if (ii == numberOfUrls) { if (e instanceof DSSException) { throw (DSSException) e; } throw new DSSException(e); } LOG.warn("Impossible to obtain data using {}", urlString, e); } } return null; }
@Override public DataAndUrl get(final List<String> urlStrings) { final int numberOfUrls = urlStrings.size(); int ii = 0; for (final String urlString : urlStrings) { try { ii++; final byte[] bytes = get(urlString); if (bytes == null) { continue; } return new DataAndUrl(bytes, urlString); } catch (Exception e) { if (ii == numberOfUrls) { if (e instanceof DSSException) { throw (DSSException) e; } throw new DSSException(e); } LOG.warn("Impossible to obtain data using '{}' : {}", urlString, e.getMessage()); } } return null; }
@Override public DataAndUrl get(List<String> urlStrings) { for (final String urlString : urlStrings) { try { final byte[] bytes = get(urlString); if (bytes != null) { return new DataAndUrl(bytes, urlString); } } catch (Exception e) { LOGGER.warn("Impossible to obtain data using {}", urlString, e); } } throw new DSSException(String.format("Impossible to obtain data using with given urls %s", urlStrings)); }
@Override public DataAndUrl get(List<String> urlStrings) { for (String url : urlStrings) { byte[] data = get(url); if (data != null) { return new DataAndUrl(data, url); } } return null; }