mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
error check on the new project name. See #519.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3278 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
6a284060d9
commit
a407d2e58d
1 file changed
+8
-1
@@ -43,6 +43,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* A job is an runnable entity under the monitoring of Hudson.
|
||||
@@ -680,11 +681,17 @@ public abstract class Job<JobT extends Job<JobT,RunT>, RunT extends Run<JobT,Run
|
||||
/**
|
||||
* Renames this job.
|
||||
*/
|
||||
public /*not synchronized. see renameTo()*/ void doDoRename( StaplerRequest req, StaplerResponse rsp ) throws IOException {
|
||||
public /*not synchronized. see renameTo()*/ void doDoRename( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
|
||||
if(!Hudson.adminCheck(req,rsp))
|
||||
return;
|
||||
|
||||
String newName = req.getParameter("newName");
|
||||
try {
|
||||
Hudson.checkGoodName(newName);
|
||||
} catch (ParseException e) {
|
||||
sendError(e,req,rsp);
|
||||
return;
|
||||
}
|
||||
|
||||
renameTo(newName);
|
||||
rsp.sendRedirect2(req.getContextPath()+'/'+getUrl()); // send to the new job page
|
||||
|
||||
Reference in new issue
Block a user