/** * @param permission * Permission needed to perform this validation, or null if no permission is necessary. */ protected FormFieldValidator(Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),permission); }
protected FormFieldValidator(AccessControlled subject, Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),subject,permission); }
/** * @deprecated since 2007-12-18. * Use {@link #checkPermission(hudson.security.Permission)} */ @Deprecated public static boolean adminCheck() throws IOException { return adminCheck(Stapler.getCurrentRequest(), Stapler.getCurrentResponse()); }
protected final void sendError(Exception e) throws ServletException, IOException { sendError(e,Stapler.getCurrentRequest(),Stapler.getCurrentResponse()); }
protected final void sendError(String message) throws ServletException, IOException { sendError(message,Stapler.getCurrentRequest(),Stapler.getCurrentResponse()); }
public long writeHtmlTo(long start, Writer w) throws IOException { ConsoleAnnotationOutputStream<T> caw = new ConsoleAnnotationOutputStream<>( w, createAnnotator(Stapler.getCurrentRequest()), context, charset); long r = super.writeLogTo(start,caw); ByteArrayOutputStream baos = new ByteArrayOutputStream(); Cipher sym = PASSING_ANNOTATOR.encrypt(); ObjectOutputStream oos = AnonymousClassWarnings.checkingObjectOutputStream(new GZIPOutputStream(new CipherOutputStream(baos,sym))); oos.writeLong(System.currentTimeMillis()); // send timestamp to prevent a replay attack oos.writeObject(caw.getConsoleAnnotator()); oos.close(); StaplerResponse rsp = Stapler.getCurrentResponse(); if (rsp!=null) rsp.setHeader("X-ConsoleAnnotator", new String(Base64.encode(baos.toByteArray()))); return r; }
StringWriter sw = new StringWriter(); XMLOutput xml = dsi.createXMLOutput(sw, true); dsi.invokeScript(Stapler.getCurrentRequest(), Stapler.getCurrentResponse(), s, this, xml); return sw.toString(); } catch (Exception e) {
public StaplerResponse getResponse() { if(response==null) response = Stapler.getCurrentResponse(); return response; }
/** * @param permission * Permission needed to perform this validation, or null if no permission is necessary. */ protected FormFieldValidator(Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),permission); }
/** * @param permission * Permission needed to perform this validation, or null if no permission is necessary. */ protected FormFieldValidator(Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),permission); }
/** * @param permission * Permission needed to perform this validation, or null if no permission is necessary. */ protected FormFieldValidator(Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),permission); }
/** * @param permission * Permission needed to perform this validation, or null if no permission is necessary. */ protected FormFieldValidator(Permission permission) { this(Stapler.getCurrentRequest(),Stapler.getCurrentResponse(),permission); }
public void run() { try { StaplerResponse rsp = Stapler.getCurrentResponse(); rsp.setStatus(200); rsp.setContentType("text/html"); r.add(c.call()); } catch (Exception e) { t[0] = e; } } });
public void run() { try { StaplerResponse rsp = Stapler.getCurrentResponse(); rsp.setStatus(200); rsp.setContentType("text/html"); r.add(c.call()); } catch (Exception e) { t[0] = e; } } });
/** * @deprecated since 2007-12-18. * Use {@link #checkPermission(hudson.security.Permission)} */ @Deprecated public static boolean adminCheck() throws IOException { return adminCheck(Stapler.getCurrentRequest(), Stapler.getCurrentResponse()); }
/** * Returns the trend graph details. * * @return the details */ public Object getTrendDetails() { return getTrendDetails(Stapler.getCurrentRequest(), Stapler.getCurrentResponse()); }
/** * Returns the trend graph. * * @return the current trend graph */ public Object getTrendGraph() { return getTrendGraph(Stapler.getCurrentRequest(), Stapler.getCurrentResponse()); }
public void doTag(XMLOutput output) throws JellyTagException { try { Stapler.getCurrentResponse().sendRedirect2(url); } catch (IOException e) { throw new JellyTagException("Failed to redirect to "+url,e); } } }
/** * Returns the trend graph. * * @return the current trend graph */ public Object getTrendGraph() { return getTrendGraph(Stapler.getCurrentRequest(), Stapler.getCurrentResponse()); }
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); } }