Example usage for java.awt.color CMMException printStackTrace

List of usage examples for java.awt.color CMMException printStackTrace

Introduction

In this page you can find the example usage for java.awt.color CMMException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.springsource.samples.resttemplate.FlickrClient.java

@SuppressWarnings("unchecked")
private List<BufferedImage> searchPhotos(String apiKey, String searchTerm) {
    String photoSearchUrl = "http://www.flickr.com/services/rest?method=flickr.photos.search&api_key={api-key}&tags={tag}&per_page=10&tag_mode=all";
    Source photos = restTemplate.getForObject(photoSearchUrl, Source.class, apiKey, searchTerm);

    final String photoUrl = "http://static.flickr.com/{server}/{id}_{secret}_m.jpg";
    return (List<BufferedImage>) xpathTemplate.evaluate("//photo", photos, new NodeMapper() {
        public Object mapNode(Node node, int i) throws DOMException {
            try {
                Element photo = (Element) node;

                Map<String, String> variables = new HashMap<String, String>(3);
                variables.put("server", photo.getAttribute("server"));
                variables.put("id", photo.getAttribute("id"));
                variables.put("secret", photo.getAttribute("secret"));

                return restTemplate.getForObject(photoUrl, BufferedImage.class, variables);
            } catch (java.awt.color.CMMException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }//  w w  w  .  j av a2s . co m
        }
    });
}