Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,62 @@ public JenkinsServer renameJob(FolderJob folder, String oldJobName, String newJo
return this;
}


/**
* Rename a folder job
*
* @param oldFolderJobName existing folderJob name.
* @param newFolderJobName The new folderJob name.
* @throws IOException In case of a failure.
*/
public JenkinsServer renameFolderJob(String oldFolderJobName, String newFolderJobName)
throws IOException {
return renameFolderJob(null, oldFolderJobName, newFolderJobName, false);
}

/**
* Rename a folder job
*
* @param oldFolderJobName existing folderJob name.
* @param newFolderJobName The new folderJob name.
* @param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
* <code>false</code> otherwise.
* @throws IOException In case of a failure.
*/
public JenkinsServer renameFolderJob(String oldFolderJobName, String newFolderJobName,
Boolean crumbFlag) throws IOException {
renameFolderJob(null, oldFolderJobName, newFolderJobName, crumbFlag);
return this;
}

/**
* Rename a folder job
*
* @param folder {@link FolderJob}
* @param oldFolderJobName existing folderJob name.
* @param newFolderJobName The new folderJob name.
* @throws IOException In case of a failure.
*/
public JenkinsServer renameFolderJob(FolderJob folder, String oldFolderJobName,
String newFolderJobName) throws IOException {
return renameFolderJob(folder, oldFolderJobName, newFolderJobName, false);
}

/**
* Rename a folder job
*
* @param folder {@link FolderJob}
* @param oldFolderJobName existing folderJob name.
* @param newFolderJobName The new folderJob name.
* @param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
* <code>false</code> otherwise.
* @throws IOException In case of a failure.
*/
public JenkinsServer renameFolderJob(FolderJob folder, String oldFolderJobName,
String newFolderJobName, Boolean crumbFlag) throws IOException {
client.post(UrlUtils.toJobBaseUrl(folder, oldFolderJobName) + "/confirmRename?newName="
+ EncodingUtils.formParameter(newFolderJobName), crumbFlag);
return this;
}

/**
* Closes underlying resources.
Expand Down