本文整理汇总了Java中hudson.model.Job.getRootDir方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getRootDir方法的具体用法?Java Job.getRootDir怎么用?Java Job.getRootDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.model.Job
的用法示例。
在下文中一共展示了Job.getRootDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doCheckSeriesFile
import hudson.model.Job; //导入方法依赖的package包/类
/**
* Checks if the series file is valid.
*/
public FormValidation doCheckSeriesFile(
@AncestorInPath Job<?, ?> project,
@QueryParameter String value) throws IOException {
FilePath fp = new FilePath( new FilePath( project.getRootDir() ), "workspace" );
//Check if workspace folder is missing form root directory
if ( fp.validateFileMask( value ) == null ) {
return new FilePath( project.getRootDir() ).validateFileMask( value );
}
return fp.validateFileMask( value );
}
示例2: JobDiskItem
import hudson.model.Job; //导入方法依赖的package包/类
public JobDiskItem(Job<?, ?> job, Long size) {
super(job.getFullDisplayName(), job.getRootDir(), size);
this.fullName = job.getFullName();
this.url = job.getUrl();
}
示例3: forProject
import hudson.model.Job; //导入方法依赖的package包/类
@Nonnull
private static GitHubPRRepository forProject(Job<?, ?> job) throws IOException {
XmlFile configFile = new XmlFile(new File(job.getRootDir(), GitHubPRRepository.FILE));
GitHubPRTrigger trigger = ghPRTriggerFromJob(job);
requireNonNull(trigger, "Can't extract PR trigger from " + job.getFullName());
final GitHubRepositoryName repoFullName = trigger.getRepoFullName(job); // ask with job because trigger may not yet be started
GithubProjectProperty property = job.getProperty(GithubProjectProperty.class);
String githubUrl = property.getProjectUrl().toString();
GitHubPRRepository localRepository;
if (configFile.exists()) {
try {
localRepository = (GitHubPRRepository) configFile.read();
} catch (IOException e) {
LOGGER.info("Can't read saved repository, re-creating new one", e);
localRepository = new GitHubPRRepository(repoFullName.toString(), new URL(githubUrl));
}
} else {
localRepository = new GitHubPRRepository(repoFullName.toString(), new URL(githubUrl));
}
localRepository.setJob(job);
localRepository.setConfigFile(configFile);
try {
localRepository.actualise(trigger.getRemoteRepository());
localRepository.save();
} catch (Throwable ignore) {
//silently try actualise
}
return localRepository;
}
示例4: forProject
import hudson.model.Job; //导入方法依赖的package包/类
@Nonnull
private static GitHubBranchRepository forProject(Job<?, ?> job) throws IOException {
XmlFile configFile = new XmlFile(new File(job.getRootDir(), GitHubBranchRepository.FILE));
GitHubBranchTrigger trigger = ghBranchTriggerFromJob(job);
requireNonNull(trigger, "Can't extract Branch trigger from " + job.getFullName());
final GitHubRepositoryName repoFullName = trigger.getRepoFullName(job); // ask with job because trigger may not yet be started
GithubProjectProperty property = job.getProperty(GithubProjectProperty.class);
String githubUrl = property.getProjectUrl().toString();
GitHubBranchRepository localRepository;
if (configFile.exists()) {
try {
localRepository = (GitHubBranchRepository) configFile.read();
} catch (IOException e) {
LOGGER.info("Can't read saved repository, re-creating new one", e);
localRepository = new GitHubBranchRepository(repoFullName.toString(), new URL(githubUrl));
}
} else {
LOGGER.info("Creating new Branch Repository for '{}'", job.getFullName());
localRepository = new GitHubBranchRepository(repoFullName.toString(), new URL(githubUrl));
}
// set transient cached fields
localRepository.setJob(job);
localRepository.setConfigFile(configFile);
try {
localRepository.actualise(trigger.getRemoteRepository());
localRepository.save();
} catch (Throwable ignore) {
//silently try actualise
}
return localRepository;
}