public Set<String> getAvailableLegendGraphicsFormats() { List<GetLegendGraphicOutputFormat> formats; formats = WMSExtensions.findLegendGraphicFormats(applicationContext); Set<String> mimeTypes = new HashSet<String>(); for (GetLegendGraphicOutputFormat format : formats) { mimeTypes.add(format.getContentType()); } return mimeTypes; }
public static GetLegendGraphicOutputFormat findLegendGraphicFormat( final String outputFormat, final ApplicationContext applicationContext) { List<GetLegendGraphicOutputFormat> formats = findLegendGraphicFormats(applicationContext); for (GetLegendGraphicOutputFormat format : formats) { if (format.getContentType().startsWith(outputFormat)) { return format; } } return null; }