hudson.FilePath.sibling()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(123)

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

FilePath.sibling介绍

[英]Short for getParent().child(rel). Useful for getting other files in the same directory.
[中]

代码示例

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

/**
 * Locates a conventional temporary directory to be associated with a workspace.
 * <p>This directory is suitable for temporary files to be deleted later in the course of a build,
 * or caches and local repositories which should persist across builds done in the same workspace.
 * (If multiple workspaces are present for a single job built concurrently, via {@link #allocate(FilePath)}, each will get its own temporary directory.)
 * <p>It may also be used for security-sensitive files which {@link DirectoryBrowserSupport} ought not serve,
 * acknowledging that these will be readable by builds of other jobs done on the same node.
 * <p>Each plugin using this directory is responsible for specifying sufficiently unique subdirectory/file names.
 * {@link FilePath#createTempFile} may be used for this purpose if desired.
 * <p>The resulting directory may not exist; you may call {@link FilePath#mkdirs} on it if you need it to.
 * It may be deleted alongside the workspace itself during cleanup actions.
 * @param ws a directory such as a build workspace
 * @return a sibling directory, for example {@code …/something@tmp} for {@code …/something}
 * @since 1.652
 */
public static FilePath tempDir(FilePath ws) {
  return ws.sibling(ws.getName() + COMBINATOR + "tmp");
}

代码示例来源:origin: org.jenkins-ci.plugins/config-file-provider

/**
 * TODO use 1.652 use WorkspaceList.tempDir
 *
 * @param ws workspace of the {@link hudson.model.Build}. See {@link Build#getWorkspace()}
 * @return temporary directory, may not have been created so far
 */
public static FilePath tempDir(FilePath ws) {
  return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

代码示例来源:origin: jenkinsci/docker-workflow-plugin

private static FilePath tempDir(FilePath ws) {
  return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

代码示例来源:origin: jenkinsci/workflow-basic-steps-plugin

private static FilePath tempDir(FilePath ws) {
  return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}

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

/**
 * Locates a conventional temporary directory to be associated with a workspace.
 * <p>This directory is suitable for temporary files to be deleted later in the course of a build,
 * or caches and local repositories which should persist across builds done in the same workspace.
 * (If multiple workspaces are present for a single job built concurrently, via {@link #allocate(FilePath)}, each will get its own temporary directory.)
 * <p>It may also be used for security-sensitive files which {@link DirectoryBrowserSupport} ought not serve,
 * acknowledging that these will be readable by builds of other jobs done on the same node.
 * <p>Each plugin using this directory is responsible for specifying sufficiently unique subdirectory/file names.
 * {@link FilePath#createTempFile} may be used for this purpose if desired.
 * <p>The resulting directory may not exist; you may call {@link FilePath#mkdirs} on it if you need it to.
 * It may be deleted alongside the workspace itself during cleanup actions.
 * @param ws a directory such as a build workspace
 * @return a sibling directory, for example {@code …/something@tmp} for {@code …/something}
 * @since 1.652
 */
public static FilePath tempDir(FilePath ws) {
  return ws.sibling(ws.getName() + COMBINATOR + "tmp");
}

代码示例来源:origin: jenkinsci/artifactory-plugin

@Override
  public FilePath call() {
    final FilePath tempDir = ws.sibling(ws.getName() + Objects.toString(workspaceList, "@") + "tmp").child("artifactory");
    File tempDirFile = new File(tempDir.getRemote());
    tempDirFile.mkdirs();
    tempDirFile.deleteOnExit();
    return tempDir;
  }
});

代码示例来源:origin: jenkinsci/shiningpanda-plugin

if (js.sibling(INDEX).exists() && (js.sibling(STATUS_LTE_3).exists() || js.sibling(STATUS).exists()))

相关文章