/** Returns the list of all the supported output formats */ public List<String> getOutputFormats() { Set<String> formats = new HashSet<String>(); List<CoverageResponseDelegate> delegates = GeoServerExtensions.extensions(CoverageResponseDelegate.class, applicationContext); for (CoverageResponseDelegate delegate : delegates) { if (delegate.isAvailable()) { formats.addAll(delegate.getOutputFormats()); } } List<String> result = new ArrayList<String>(formats); Collections.sort(result); return result; }
/** Locates an encoder for a specific GetCoverage results output format */ public CoverageResponseDelegate encoderFor(String outputFormat) { // lookup the encoders dynamically (the list returned might be subject to dynamic extension // filters, so we don't cache it) List<CoverageResponseDelegate> delegates = GeoServerExtensions.extensions(CoverageResponseDelegate.class, applicationContext); for (CoverageResponseDelegate delegate : delegates) { if (delegate.isAvailable() && delegate.canProduce(outputFormat)) { return delegate; } } return null; }