GradientColorMapGenerator generator = null;
Resource xmlFile = null;
if (!colorMap.startsWith(GradientColorMapGenerator.RGB_INLINEVALUE_MARKER)
&& !colorMap.startsWith(GradientColorMapGenerator.HEX_INLINEVALUE_MARKER)) {
GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
colorMap = colorMap.replace('\\', '/');
String path = Paths.path("styles", "ramps", colorMap + ".svg");
xmlFile = loader.get( path );
if( xmlFile.getType() != Type.RESOURCE ){
throw new IllegalArgumentException(
"The specified colorMap do not exist in the styles/ramps folder\n"
+ "Check that "
+ path