hudson.model.Job.renameTo()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中hudson.model.Job.renameTo()方法的一些代码示例,展示了Job.renameTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.renameTo()方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:renameTo

Job.renameTo介绍

[英]Renames a job.
[中]

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

public void superRenameTo(String newName) throws IOException {
  super.renameTo(newName);
}

代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper

@Override
public void renameTo(String newName) throws IOException {
  initPython();
  if (pexec.isImplemented(36)) {
    pexec.execPythonVoid("rename_to", newName);
  } else {
    super.renameTo(newName);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

job.renameTo(qualifiedNewJobName);
oldTeam.removeJob(oldJobName);

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * Renames this job.
 */
@RequirePOST
public/* not synchronized. see renameTo() */void doDoRename(
    StaplerRequest req, StaplerResponse rsp) throws IOException,
    ServletException {
  if (!hasPermission(CONFIGURE)) {
    // rename is essentially delete followed by a create
    checkPermission(CREATE);
    checkPermission(DELETE);
  }
  String newName = req.getParameter("newName");
  Jenkins.checkGoodName(newName);
  if (isBuilding()) {
    // redirect to page explaining that we can't rename now
    rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
    return;
  }
  renameTo(newName);
  // send to the new job page
  // note we can't use getUrl() because that would pick up old name in the
  // Ancestor.getUrl()
  rsp.sendRedirect2("../" + newName);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Renames this job.
 */
public/* not synchronized. see renameTo() */void doDoRename(
    StaplerRequest req, StaplerResponse rsp) throws IOException,
    ServletException {
  requirePOST();
  // rename is essentially delete followed by a create
  checkPermission(CREATE);
  checkPermission(DELETE);
  String newName = req.getParameter("newName");
  Hudson.checkGoodName(newName);
  if (isBuilding()) {
    // redirect to page explaining that we can't rename now
    rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
    return;
  }
  renameTo(newName);
  // send to the new job page
  // note we can't use getUrl() because that would pick up old name in the
  // Ancestor.getUrl()
  rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
      + getShortUrl());
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Renames this job.
 */
public/* not synchronized. see renameTo() */void doDoRename(
    StaplerRequest req, StaplerResponse rsp) throws IOException,
    ServletException {
  requirePOST();
  // rename is essentially delete followed by a create
  checkPermission(CREATE);
  checkPermission(DELETE);
  String newName = req.getParameter("newName");
  Hudson.checkGoodName(newName);
  if (isBuilding()) {
    // redirect to page explaining that we can't rename now
    rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
    return;
  }
  renameTo(newName);
  // send to the new job page
  // note we can't use getUrl() because that would pick up old name in the
  // Ancestor.getUrl()
  rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
      + getShortUrl());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Renames this job.
 */
public/* not synchronized. see renameTo() */ void doDoRename(
    StaplerRequest req, StaplerResponse rsp) throws IOException,
    ServletException {
  requirePOST();
  // rename is essentially delete followed by a create
  checkPermission(CREATE);
  checkPermission(DELETE);
  String newName = req.getParameter("newName");
  Hudson.checkGoodName(newName);
  if (isBuilding()) {
    // redirect to page explaining that we can't rename now
    rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
    return;
  }
  renameTo(newName);
  // send to the new job page
  // note we can't use getUrl() because that would pick up old name in the
  // Ancestor.getUrl()
  rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
      + getShortUrl());
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

renameTo(newName);

相关文章

微信公众号

最新文章

更多

Job类方法