tags:

views:

39

answers:

1

I want to check if a given URL exists and it's an image, in order to create a new Image(String url) from it. If the given URL is not an image then it should return an error.

+3  A: 

You could do this with a RequestBuilder -- just request the image URL, use the Response's getHeaders() method to get the content type, and check if it's an image.

Jason Hall