List of usage examples for com.amazonaws.util IOUtils toString
public static String toString(InputStream is) throws IOException
From source file:org.icgc.dcc.storage.client.exception.ControlExceptionFactory.java
License:Open Source License
public static NotResumableException notResumableException(String prefix, ClientHttpResponse response) throws IOException { return new NotResumableException( new IOException((prefix == null ? "" : prefix) + IOUtils.toString(response.getBody()))); }
From source file:org.researchgraph.crossref.CrossRef.java
private String getCahcedFile(String file) throws IOException { if (null != cache) { File f = new File(cache, file); if (f.exists() && !f.isDirectory()) { return FileUtils.readFileToString(f); }/*from www . jav a 2 s. com*/ } else if (null != s3Client) { S3Object o = s3Client.getObject(new GetObjectRequest(s3Bucket, getS3Key(file))); if (null != o) { try (InputStream is = o.getObjectContent()) { return IOUtils.toString(is); } } } return null; }