Example usage for com.amazonaws.util IOUtils toString

List of usage examples for com.amazonaws.util IOUtils toString

Introduction

In this page you can find the example usage for com.amazonaws.util IOUtils toString.

Prototype

public static String toString(InputStream is) throws IOException 

Source Link

Document

Reads and returns the rest of the given input stream as a string.

Usage

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;
}