GeoServerResourceLoader rl = geoServer.getCatalog().getResourceLoader();
Resource resource = rl.get(Paths.path("workspaces",ws.getName(),"styles",icon));
if( resource.getType() != Type.RESOURCE ){
throw new NotFoundException("Icon "+icon+" not found");
}
String ext = fileExt(icon);
if( !ICON_FORMATS.containsKey(ext)){
throw new NotFoundException("Icon "+icon+" format unsupported");
}
String mimeType = ICON_FORMATS.get(ext.toLowerCase());
response.setContentType(mimeType);
//response.setStatus(HttpServletResponse.SC_OK);