本文整理了Java中jenkins.model.Jenkins.getBuildDirFor()
方法的一些代码示例,展示了Jenkins.getBuildDirFor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getBuildDirFor()
方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getBuildDirFor
暂无
代码示例来源:origin: jenkinsci/jenkins
/**
* Directory for storing {@link Run} records.
* <p>
* Some {@link Job}s may not have backing data store for {@link Run}s, but
* those {@link Job}s that use file system for storing data should use this
* directory for consistency.
*
* @see RunMap
*/
public File getBuildDir() {
// we use the null check variant so that people can write true unit tests with a mock ItemParent
// and without a JenkinsRule. Such tests are of limited utility as there is a high risk of hitting
// some code that needs the singleton, but for persistence migration test cases it makes sense to permit
Jenkins j = Jenkins.getInstanceOrNull();
if (j == null) {
return new File(getRootDir(), "builds");
}
return j.getBuildDirFor(this);
}
代码示例来源:origin: org.jenkins-ci.plugins/disk-usage
private void removeDeletedBuilds(){
Iterator<DiskUsageBuildInformation> iterator= buildDiskUsage.iterator();
while(iterator.hasNext()){
DiskUsageBuildInformation information = iterator.next();
File buildDir = new File(Jenkins.getInstance().getBuildDirFor(job), information.getId());
if(!buildDir.exists())
buildDiskUsage.remove(information);
}
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Directory for storing {@link Run} records.
* <p>
* Some {@link Job}s may not have backing data store for {@link Run}s, but
* those {@link Job}s that use file system for storing data should use this
* directory for consistency.
*
* @see RunMap
*/
public File getBuildDir() {
// we use the null check variant so that people can write true unit tests with a mock ItemParent
// and without a JenkinsRule. Such tests are of limited utility as there is a high risk of hitting
// some code that needs the singleton, but for persistence migration test cases it makes sense to permit
Jenkins j = Jenkins.getInstanceOrNull();
if (j == null) {
return new File(getRootDir(), "builds");
}
return j.getBuildDirFor(this);
}
代码示例来源:origin: org.jenkins-ci.plugins/disk-usage
Set<DiskUsageBuildInformation> informations = project.getAction(ProjectDiskUsageAction.class).getBuildsInformation();
for(DiskUsageBuildInformation information : informations){
exceededFiles.add(new File(Jenkins.getInstance().getBuildDirFor(project), information.getId()));
代码示例来源:origin: org.jenkins-ci.plugins/disk-usage
long buildSize = DiskUsageUtil.getFileSize(new File(Jenkins.getInstance().getBuildDirFor(project), buildId), new ArrayList<File>());
内容来源于网络,如有侵权,请联系作者删除!