/** {@inheritDoc} */ @Override public String getContentType() { return getWrapped().getContentType(); }
/** {@inheritDoc} */ @Override public String getContentType() { return getWrapped().getContentType(); }
protected XMLOutput createXMLOutput(StaplerRequest req, StaplerResponse rsp, Script script, Object it) throws IOException { // TODO: make XMLOutput auto-close OutputStream to avoid leak HTMLWriterOutput hwo = HTMLWriterOutput.create(createOutputStream(req, rsp, script, it)); String ct = rsp.getContentType(); if (ct != null && !ct.startsWith("text/html")) hwo.useHTML(false); return hwo; }
public XMLOutput createXMLOutput(Writer writer, boolean escapeText) { StaplerResponse rsp = Stapler.getCurrentResponse(); String ct = rsp!=null ? rsp.getContentType() : "?"; if (ct != null && !ct.startsWith("text/html")) return XMLOutput.createXMLOutput(writer, escapeText); return HTMLWriterOutput.create(writer, escapeText); } }
protected XMLOutput createXMLOutput(StaplerRequest req, StaplerResponse rsp, Script script, Object it) throws IOException { // TODO: make XMLOutput auto-close OutputStream to avoid leak HTMLWriterOutput hwo = HTMLWriterOutput.create(createOutputStream(req, rsp, script, it)); String ct = rsp.getContentType(); if (ct != null && !ct.startsWith("text/html")) hwo.useHTML(false); return hwo; }
public XMLOutput createXMLOutput(Writer writer, boolean escapeText) { StaplerResponse rsp = Stapler.getCurrentResponse(); String ct = rsp!=null ? rsp.getContentType() : "?"; if (ct != null && !ct.startsWith("text/html")) return XMLOutput.createXMLOutput(writer, escapeText); return HTMLWriterOutput.create(writer, escapeText); }
if (rsp.getContentType() == null) { // test hack for JenkinsRule#executeOnServer rsp.setContentType("text/xml");