@Test public void setResponseHeaders() { ctx.requestPathInfo().setResourcePath("/content/dam/test.png"); ctx.requestPathInfo().setExtension("rendition"); ctx.requestPathInfo().setSuffix("testing/asset.rendition"); final AssetRenditionParameters params = new AssetRenditionParameters(ctx.request()); new AssetRenditionServlet().setResponseHeaders(ctx.response(), params); assertEquals("filename=test.testing.png", ctx.response().getHeader("Content-Disposition")); }
protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } }
AssetRenditionServlet extends SlingSafeMethodsServlet { protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } } }
AssetRenditionServlet extends SlingSafeMethodsServlet { protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } }  }
AssetRenditionServlet extends SlingSafeMethodsServlet { protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } }  final void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response); }
AssetRenditionServlet extends SlingSafeMethodsServlet { protected void setResponseHeaders(final SlingHttpServletResponse response, final AssetRenditionParameters parameters) { if (parameters.isDownload()) { response.setHeader("Content-Disposition", String.format("attachment; filename=%s", parameters.getFileName())); } else { response.setHeader("Content-Disposition", String.format("filename=%s", parameters.getFileName())); } }  final void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response); static final String SERVLET_EXTENSION; }