I need to chech for the content type (if it\'s image, audio or video) of an url which has been inserted by the user. I have a code like this:
URL url = new U
Thanks to DaveHowes answer and googling around about how to get HEAD I got it in this way:
URL url = new URL(urlname);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("HEAD");
connection.connect();
String contentType = connection.getContentType();