hudson.model.Hudson.copy()方法的使用及代码示例

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

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

Hudson.copy介绍

[英]Copys a job.
[中]抄袭是一项工作。

代码示例

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

public <T extends AbstractProject<?, ?>> T copy(T src, String name) throws IOException {
  return (T) copy((TopLevelItem) src, name);
}

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

public <T extends AbstractProject<?, ?>> T copy(T src, String name) throws IOException {
  return (T) copy((TopLevelItem) src, name);
}

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

public <T extends AbstractProject<?, ?>> T copy(T src, String name) throws IOException {
  return (T) copy((TopLevelItem) src, name);
}

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

public <T extends AbstractProject<?, ?>> T copy(T src, String name) throws IOException {
  return (T) copy((TopLevelItem) src, name);
}

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

protected int run() throws Exception {
    Hudson h = Hudson.getInstance();
    h.checkPermission(Item.CREATE);

    if (h.getItem(dst)!=null) {
      stderr.println("Job '"+dst+"' already exists");
      return -1;
    }
    
    h.copy(src,dst);
    Job newJob = (Job)Hudson.getInstance().getItem(dst);
    if (forceSave && null != newJob) {
      newJob.save();
    }
    return 0;
  }
}

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

protected int run() throws Exception {
    Hudson h = Hudson.getInstance();
    h.checkPermission(Item.CREATE);

    if (h.getItem(dst)!=null) {
      stderr.println("Job '"+dst+"' already exists");
      return -1;
    }
    
    h.copy(src,dst);
    Job newJob = (Job)Hudson.getInstance().getItem(dst);
    if (forceSave && null != newJob) {
      newJob.save();
    }
    return 0;
  }
}

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

protected int run() throws Exception {
    Hudson h = Hudson.getInstance();
    h.checkPermission(Item.CREATE);

    if (h.getItem(dst)!=null) {
      stderr.println("Job '"+dst+"' already exists");
      return -1;
    }
    
    h.copy(src,dst);
    Job newJob = (Job)Hudson.getInstance().getItem(dst);
    if (forceSave && null != newJob) {
      newJob.save();
    }
    return 0;
  }
}

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

public <T extends AbstractProject<?, ?>> T copyProject(final T src, final String targetProjectName)
    throws ServiceRuntimeException {
  checkNotNull(src, AbstractProject.class);
  checkProjectName(targetProjectName);
  this.securityService.checkPermission(Item.CREATE);
  this.securityService.checkPermission(src, Item.EXTENDED_READ);
  // caller should try to verify this themselves before calling me
  // TODO should this check really be performed here?
  if (projectExists(targetProjectName)) {
    throw new SystemIntegrityViolationException(String.format("Project %s already exists.", targetProjectName));
  }
  try {
    return getHudson().copy(src, targetProjectName);
  } catch (IOException ex) {
    throw new ServiceRuntimeException(String.format("Project copy failed from %s to %s", src.getName(),
        targetProjectName), ex);
  }
}

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

public <T extends AbstractProject<?, ?>> T copyProject(final T src, final String targetProjectName)
    throws ServiceRuntimeException {
  checkNotNull(src, AbstractProject.class);
  checkProjectName(targetProjectName);
  this.securityService.checkPermission(Item.CREATE);
  this.securityService.checkPermission(src, Item.EXTENDED_READ);
  // caller should try to verify this themselves before calling me
  // TODO should this check really be performed here?
  if (projectExists(targetProjectName)) {
    throw new SystemIntegrityViolationException(String.format("Project %s already exists.", targetProjectName));
  }
  try {
    return getHudson().copy(src, targetProjectName);
  } catch (IOException ex) {
    throw new ServiceRuntimeException(String.format("Project copy failed from %s to %s", src.getName(),
        targetProjectName), ex);
  }
}

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

TopLevelItem newJob = h.copy(src, dst, team);

相关文章

Hudson类方法