NativeHTTPDataLoader implements DataLoader { @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 DataAndUrl get(List<String> urlStrings); @Override byte[] get(String url); @Override byte[] get(String url, boolean refresh); @Override byte[] post(String url, byte[] content); @Override void setContentType(String contentType); long getMaxInputSize(); void setMaxInputSize(long maxInputSize); long getTimeout(); void setTimeout(long timeout);  }
@Test public void testHttpGet() { NativeHTTPDataLoader dataLoader = new NativeHTTPDataLoader(); byte[] bytesArray = dataLoader.get(HTTP_URL_TO_LOAD); CertificateToken certificate = DSSUtils.loadCertificate(bytesArray); assertNotNull(certificate); }
@Test public void testFileGet() { NativeHTTPDataLoader dataLoader = new NativeHTTPDataLoader(); byte[] bytesArray = dataLoader.get(FILE_URL_TO_LOAD); CertificateToken certificate = DSSUtils.loadCertificate(bytesArray); assertNotNull(certificate); }