Example usage for org.springframework.social.facebook.api ImageType toString

List of usage examples for org.springframework.social.facebook.api ImageType toString

Introduction

In this page you can find the example usage for org.springframework.social.facebook.api ImageType toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:org.springframework.social.facebook.api.impl.FacebookTemplate.java

public byte[] fetchImage(String objectId, String connectionType, ImageType type) {
    URI uri = URIBuilder/* www.j  a va 2 s  .  co m*/
            .fromUri(GRAPH_API_URL + objectId + "/" + connectionType + "?type=" + type.toString().toLowerCase())
            .build();
    ResponseEntity<byte[]> response = getRestTemplate().getForEntity(uri, byte[].class);
    if (response.getStatusCode() == HttpStatus.FOUND) {
        throw new UnsupportedOperationException(
                "Attempt to fetch image resulted in a redirect which could not be followed. Add Apache HttpComponents HttpClient to the classpath "
                        + "to be able to follow redirects.");
    }
    return response.getBody();
}