private void handleSupportedFormats(CoverageInfo ci) throws Exception { // gather all the formats for this coverage Set<String> formats = new HashSet<String>(); for (Iterator it = ci.getSupportedFormats().iterator(); it.hasNext();) { String format = (String) it.next(); // wcs 1.1 requires mime types, not format names try { CoverageResponseDelegate delegate = CoverageResponseDelegateFactory .encoderFor(format); String formatMime = delegate.getMimeFormatFor(format); if(formatMime != null) formats.add(formatMime); } catch(Exception e) { // no problem, we just want to avoid people writing HALLABALOOLA in the // supported formats section of the coverage config and then break the // describe response } } // sort them List<String> sortedFormats = new ArrayList<String>(formats); Collections.sort(sortedFormats); for (String format : sortedFormats) { element("wcs:SupportedFormat", format); } }
String supportedFormat = ""; if (((cv.getSupportedFormats() != null) && (cv.getSupportedFormats().size() > 0))) { tempResponse.append("\n <supportedFormats" + (((nativeFormat != null) && (nativeFormat != "")) ? (" nativeFormat=\"" + nativeFormat + "\"") : "") + ">"); for (int i = 0; i < cv.getSupportedFormats().size(); i++) { supportedFormat = (String) cv.getSupportedFormats().get(i); supportedFormat = (supportedFormat.equalsIgnoreCase("GEOTIFF") ? "GeoTIFF" : supportedFormat);
meta = catalog.getCoverageInfo(request.getCoverage()); if (!meta.getSupportedFormats().contains(outputFormat.toUpperCase())) { WcsException newEx = new WcsException(new StringBuffer("output format: ").append( outputFormat).append(" not ")
String declaredFormat = getDeclaredFormat(meta.getSupportedFormats(), format); if (declaredFormat == null) throw new WcsException("format " + format + " is not supported for this coverage",