@Override public void dispose() { if (metaTileMap != null) { metaTileMap.dispose(); metaTileMap = null; } super.dispose(); } }
/** * Disposes any resource held by this Map. * * <p>This method is meant to be called right after the map is no longer needed. That generally * happens at the end of a {@link Response#write} operation, and is meant to free any resource * the map implementation might be holding, specially if it contains a refrerence to {@link * WMSMapContent}, in which case it's mandatory that the map context's {@link * WMSMapContent#dispose()} method is called. */ public final void dispose() { if (mapContent != null) { mapContent.dispose(); } disposeInternal(); }
@Override public String getAttachmentFileName(Object value, Operation operation) { Assert.isInstanceOf(WebMap.class, value); // defer to WebMap - it has the extension and other information return ((WebMap) value).getAttachmentFileName(); }
dynamicResult.setResponseHeader("geowebcache-cache-result", MISS.toString()); dynamicResult.setResponseHeader( "geowebcache-miss-reason", requestMistmatchTarget.toString()); return dynamicResult;
/** * @return {@code ((WebMap)value).getMimeType()} * @see org.geoserver.ows.Response#getMimeType(java.lang.Object, * org.geoserver.platform.Operation) */ @Override public String getMimeType(Object value, Operation operation) throws ServiceException { Assert.isInstanceOf(WebMap.class, value); return ((WebMap) value).getMimeType(); }
public String getAttachmentFileName() { String filename = getSimpleAttachmentFileName(); if (filename != null && extension != null) { return filename + extension; } return filename; }
/** * Utility method to build a standard content disposition header. * * <p>It will concatenate the titles of the various layers in the map context, or generate * "geoserver" instead (in the event no layer title is set). * * <p>The file name will be followed by the extension provided, for example, to generate * layer.pdf extension will be ".pdf" */ public void setContentDispositionHeader( final WMSMapContent mapContent, final String extension) { setContentDispositionHeader(mapContent, extension, true); }
@Override public String getPreferredDisposition(Object value, Operation operation) { Assert.isInstanceOf(WebMap.class, value); // defer to WebMap - it has the extension and other information return ((WebMap) value).getDisposition(); }
/** * Returns a 2xn array of Strings, each of which is an HTTP header pair to be set on the HTTP * Response. Can return null if there are no headers to be set on the response. * * @param value must be a {@link WebMap} * @param operation The operation being performed. * @return {@link WebMap#getResponseHeaders()}: 2xn string array containing string-pairs of HTTP * headers/values * @see Response#getHeaders(Object, Operation) * @see WebMap#getResponseHeaders() */ @Override public String[][] getHeaders(Object value, Operation operation) throws ServiceException { Assert.isInstanceOf(WebMap.class, value); WebMap map = (WebMap) value; String[][] responseHeaders = map.getResponseHeaders(); return responseHeaders; } }
dynamicResult.setResponseHeader("geowebcache-cache-result", MISS.toString()); dynamicResult.setResponseHeader("geowebcache-miss-reason", requestMistmatchTarget.toString()); return dynamicResult;
return new RenderedImageMap(mapContent, imageList, map.getMimeType()); } else if ((numElevations > 1 || singleElevationRange) && isMultivaluedSupported) { WebMap map = null; return new RenderedImageMap(mapContent, imageList, map.getMimeType()); } else { return executeInternal(mapContent, request, delegate, times, elevations);
map.setResponseHeader("Cache-Control", "max-age=" + maxAge + ", must-revalidate"); DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z"); format.setTimeZone(TimeZone.getTimeZone("GMT")); map.setResponseHeader("Expires", format.format(calendar.getTime()));
((RenderedImageMap) wmsResponse).getMapContext(), imageList, wmsResponse.getMimeType());