提交 38da8333 编写于 作者: K kohsuke

[FIXED HUDSON-4802] in 1.334. The patch was slightly modified.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23626 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f8e2a28e
......@@ -24,6 +24,9 @@
package hudson.model;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
import javax.servlet.http.HttpServletResponse;
import hudson.ExtensionPoint;
import hudson.Util;
import hudson.XmlFile;
......@@ -1045,6 +1048,32 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
throws IOException, ServletException, FormException {
}
/**
* Accepts and serves the job description
*/
public void doDescription(StaplerRequest req, StaplerResponse rsp)
throws IOException {
if (req.getMethod().equals("GET")) {
//read
rsp.setContentType("text/plain;charset=UTF-8");
rsp.getWriter().write(this.getDescription());
return;
}
if (req.getMethod().equals("POST")) {
checkPermission(CONFIGURE);
// submission
if (req.getParameter("description") != null) {
this.setDescription(req.getParameter("description"));
rsp.sendError(SC_NO_CONTENT);
return;
}
}
// huh?
rsp.sendError(SC_BAD_REQUEST);
}
/**
* Returns the image that shows the current buildCommand status.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册