I've been trying to get the MIME type of a file and then check if the file is one of css, but it doesn't seem to be working. The snippet is:
String fileName = '/'+uri.getPath().substring(PATH.length());
URLConnection inputURL = getClass().getResource(fileName).openConnection();
InputStream inputStream = null;
try {
inputURL.setUseCaches(false);
inputStream = inputURL.getInputStream();
String mimeType = inputURL.getContentType();
if (inputStream != null) {
if (mimeType.equals("text/css")) {...}
else{...}...