// Handled, return true so no further processing is done
return true;
}
synchronized (SCSS_MUTEX) {
String realFilename = sc.getRealPath(scssFilename);
ScssStylesheet scss = ScssStylesheet.get(realFilename);
if (scss == null) {
// Not a file in the file system (WebContent directory). Use the
// identifier directly (VAADIN/themes/.../styles.css) so
// ScssStylesheet will try using the class loader.
if (scssFilename.startsWith("/")) {
scssFilename = scssFilename.substring(1);
}
scss = ScssStylesheet.get(scssFilename);
}
if (scss == null) {
getLogger()
.log(Level.WARNING,
"Scss file {0} exists but ScssStylesheet was not able to find it",
scssFilename);
return false;
}
try {
getLogger().log(Level.FINE, "Compiling {0} for request to {1}",
new Object[] { realFilename, filename });
scss.compile();
} catch (Exception e) {
e.printStackTrace();
return false;
}
// This is for development mode only so instruct the browser to
// never
// cache it
response.setHeader("Cache-Control", "no-cache");
final String mimetype = getService().getMimeType(filename);
writeResponse(response, mimetype, scss.toString());
return true;
}
}