hudson.model.TopLevelItem.getRootDir()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(107)

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

TopLevelItem.getRootDir介绍

暂无

代码示例

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

final File rootDir = result.getRootDir();
result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() {
  @Override public T call() throws IOException {

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

@Override
public File getRootDir() {
  return item().getRootDir();
}

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

@Override
protected void add(TopLevelItem item) {
  assert item.getRootDir().exists();
  final LazyTopLevelItem lzItem = Items.newLazyTopLevelItem(item);
  items.put(item.getName(), lzItem);
}

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

static LazyTopLevelItem newLazyTopLevelItem(TopLevelItem item) {
  // Don't wrap - make this method idempotent
  if (item instanceof LazyTopLevelItem) {
    return (LazyTopLevelItem) item;
  }
  return newLazyTopLevelItem(item.getParent(), item.getRootDir(), item);
}

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

/**
 * {@inheritDoc}
 * <p/>
 * If {@link Hudson#HUDSON_WORKSPACES_PROPERTY_KEY} is set through JNDI
 * or system properties or environment variables. workspaceRoot will be set based on property value.
 */
public FilePath getWorkspaceFor(TopLevelItem item) {
  String workspaceRoot = getConfiguredWorkspaceRoot();
  if (StringUtils.isNotBlank(workspaceRoot)) {
    return new FilePath(new File(workspaceRoot + "/" + item.getName(), WORKSPACE_DIRNAME));
  } else {
    return new FilePath(new File(item.getRootDir(), WORKSPACE_DIRNAME));
  }
}

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

/**
 * {@inheritDoc}
 * <p/>
 * If {@link Hudson#HUDSON_WORKSPACES_PROPERTY_KEY} is set through JNDI
 * or system properties or environment variables. workspaceRoot will be set based on property value.
 */
public FilePath getWorkspaceFor(TopLevelItem item) {
  String workspaceRoot = getConfiguredWorkspaceRoot();
  if (StringUtils.isNotBlank(workspaceRoot)) {
    return new FilePath(new File(workspaceRoot + "/" + item.getName(), WORKSPACE_DIRNAME));
  } else {
    return new FilePath(new File(item.getRootDir(), WORKSPACE_DIRNAME));
  }
}

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

/**
 * {@inheritDoc}
 * <p/>
 * If {@link Hudson#HUDSON_WORKSPACES_PROPERTY_KEY} is set through JNDI
 * or system properties or environment variables. workspaceRoot will be set based on property value.
 */
public FilePath getWorkspaceFor(TopLevelItem item) {
  String workspaceRoot = getConfiguredWorkspaceRoot();
  if (StringUtils.isNotBlank(workspaceRoot)) {
    return new FilePath(new File(workspaceRoot + "/" + item.getName(), WORKSPACE_DIRNAME));
  } else {
    return new FilePath(new File(item.getRootDir(), WORKSPACE_DIRNAME));
  }
}

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

/**
 * {@inheritDoc}
 * <p/>
 * If {@link Hudson#HUDSON_WORKSPACES_PROPERTY_KEY} is set through JNDI or
 * system properties or environment variables. workspaceRoot will be set
 * based on property value.
 */
public FilePath getWorkspaceFor(TopLevelItem item) {
  String workspaceRoot = getConfiguredWorkspaceRoot();
  if (StringUtils.isNotBlank(workspaceRoot)) {
    return new FilePath(new File(workspaceRoot + "/" + item.getName(), WORKSPACE_DIRNAME));
  } else {
    return new FilePath(new File(item.getRootDir(), WORKSPACE_DIRNAME));
  }
}

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

File rootDir = item.getRootDir();
if (rootDir.exists()) {
  try {

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

result = (T) Items.load(parent, result.getRootDir());
result.onCopiedFrom(src);

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

/**
 * Copies an existing {@link TopLevelItem} to a new name.
 *
 * The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
 * cannot do that because it doesn't know how to make the newly added item reachable from the parent.
 */
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
  acl.checkPermission(Job.CREATE);
  T result = (T)createProject(src.getDescriptor(),name,false);
  // copy config
  Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
  // reload from the new config
  result = (T)Items.load(parent,result.getRootDir());
  result.onCopiedFrom(src);
  add(result);
  ItemListener.fireOnCopied(src,result);
  return result;
}

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

/**
 * Copies an existing {@link TopLevelItem} to a new name.
 *
 * The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
 * cannot do that because it doesn't know how to make the newly added item reachable from the parent.
 */
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
  acl.checkPermission(Job.CREATE);
  T result = (T)createProject(src.getDescriptor(),name,false);
  // copy config
  Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
  // reload from the new config
  result = (T)Items.load(parent,result.getRootDir());
  result.onCopiedFrom(src);
  add(result);
  ItemListener.fireOnCopied(src,result);
  return result;
}

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

/**
 * Copies an existing {@link TopLevelItem} to a new name.
 *
 * The caller is responsible for calling {@link ItemListener#fireOnCopied(Item, Item)}. This method
 * cannot do that because it doesn't know how to make the newly added item reachable from the parent.
 */
@SuppressWarnings({"unchecked"})
public synchronized <T extends TopLevelItem> T copy(T src, String name) throws IOException {
  acl.checkPermission(Job.CREATE);
  T result = (T)createProject(src.getDescriptor(),name,false);
  // copy config
  Util.copyFile(Items.getConfigFile(src).getFile(),Items.getConfigFile(result).getFile());
  // reload from the new config
  result = (T)Items.load(parent,result.getRootDir());
  result.onCopiedFrom(src);
  add(result);
  ItemListener.fireOnCopied(src,result);
  return result;
}

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

final File rootDir = result.getRootDir();
result = Items.whileUpdatingByXml(new NotReallyRoleSensitiveCallable<T,IOException>() {
  @Override public T call() throws IOException {

相关文章