How do I create a java.net.URL to refer to a CSS? Is it posible?
I've tried several other ways like this to check if its a css page but it doesn't work (no errors tho, but it doesn't):
int code = con.getResponseCode();
String type = con.getContentType();
con.disconnect();
//returns null if the connection had problems or its does not contain css
if (code != HttpURLConnection.HTTP_OK || !type.contains("stylesheet")) {
return null;
}
Any other posible solutions? Basically what I try to do is get the css page and print it.
linkelement that has aref="stylesheet"attribute.stylesheetis not the content type,text/cssis.