String fileUrl = "http://example.com/myimage.jpg";
String contentType = URLConnection.guessContentTypeFromName(fileUrl);
and the result would be:
image/jpeg
String fileUrl = "http://example.com/myimage.jpg";
String contentType = URLConnection.guessContentTypeFromName(fileUrl);