2010-08-10 36 views

Respuesta

24

Compruebe si el encabezado de respuesta HTTP Content-Type comienza con image/.

URLConnection connection = new URL("http://foo.bar/w23afv").openConnection(); 
String contentType = connection.getHeaderField("Content-Type"); 
boolean image = contentType.startsWith("image/"); 
Cuestiones relacionadas