hudson.model.AbstractItem.delete()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(76)

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

AbstractItem.delete介绍

[英]Deletes this item.
[中]删除此项目。

代码示例

代码示例来源:origin: jenkinsci/jenkins

@Override public void delete() throws IOException, InterruptedException {
  super.delete();
  Util.deleteRecursive(getBuildDir());
}

代码示例来源:origin: jenkinsci/jenkins

job.delete();
} catch (Exception e) {
  if(hs.size() == 1) {

代码示例来源:origin: jenkinsci/jenkins

/**
 * Deletes this item.
 * Note on the funny name: for reasons of historical compatibility, this URL is {@code /doDelete}
 * since it predates {@code <l:confirmationLink>}. {@code /delete} goes to a Jelly page
 * which should now be unused by core but is left in case plugins are still using it.
 */
@RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  delete();
  if (req == null || rsp == null) { // CLI
    return;
  }
  List<Ancestor> ancestors = req.getAncestors();
  ListIterator<Ancestor> it = ancestors.listIterator(ancestors.size());
  String url = getParent().getUrl(); // fallback but we ought to get to Jenkins.instance at the root
  while (it.hasPrevious()) {
    Object a = it.previous().getObject();
    if (a instanceof View) {
      url = ((View) a).getUrl();
      break;
    } else if (a instanceof ViewGroup && a != this) {
      url = ((ViewGroup) a).getUrl();
      break;
    }
  }
  rsp.sendRedirect2(req.getContextPath() + '/' + url);
}

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

@Override public void delete() throws IOException, InterruptedException {
  super.delete();
  Util.deleteRecursive(getBuildDir());
}

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

job.delete();
} catch (Exception e) {
  if(hs.size() == 1) {

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

/**
 * Deletes this item.
 * Note on the funny name: for reasons of historical compatibility, this URL is {@code /doDelete}
 * since it predates {@code <l:confirmationLink>}. {@code /delete} goes to a Jelly page
 * which should now be unused by core but is left in case plugins are still using it.
 */
@RequirePOST
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  delete();
  if (req == null || rsp == null) { // CLI
    return;
  }
  List<Ancestor> ancestors = req.getAncestors();
  ListIterator<Ancestor> it = ancestors.listIterator(ancestors.size());
  String url = getParent().getUrl(); // fallback but we ought to get to Jenkins.instance at the root
  while (it.hasPrevious()) {
    Object a = it.previous().getObject();
    if (a instanceof View) {
      url = ((View) a).getUrl();
      break;
    } else if (a instanceof ViewGroup && a != this) {
      url = ((ViewGroup) a).getUrl();
      break;
    }
  }
  rsp.sendRedirect2(req.getContextPath() + '/' + url);
}

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

/**
 * Deletes this item.
 */
@CLIMethod(name = "delete-job")
public void doDoDelete(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
  requirePOST();
  delete();
  if (rsp != null) // null for CLI
  {
    rsp.sendRedirect2(req.getContextPath() + "/" + getParent().getUrl());
  }
}

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

/**
 * Deletes this item.
 */
@CLIMethod(name="delete-job")
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  requirePOST();
  delete();
  if (rsp != null) // null for CLI
    rsp.sendRedirect2(req.getContextPath()+"/"+getParent().getUrl());
}

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

/**
 * Deletes this item.
 */
@CLIMethod(name="delete-job")
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  requirePOST();
  delete();
  if (rsp != null) // null for CLI
    rsp.sendRedirect2(req.getContextPath()+"/"+getParent().getUrl());
}

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

/**
 * Deletes this item.
 */
@CLIMethod(name="delete-job")
public void doDoDelete( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException, InterruptedException {
  requirePOST();
  delete();
  if (rsp != null) // null for CLI
    rsp.sendRedirect2(req.getContextPath()+"/"+getParent().getUrl());
}

相关文章