当前位置: 首页>>代码示例>>Java>>正文


Java Job.getRootDir方法代码示例

本文整理汇总了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 );
}
 
开发者ID:MarkusDNC,项目名称:plot-plugin,代码行数:14,代码来源:PlotPipelineDescriptor.java

示例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();
}
 
开发者ID:jenkinsci,项目名称:cloudbees-disk-usage-simple-plugin,代码行数:6,代码来源:JobDiskItem.java

示例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;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:36,代码来源:GitHubPRRepositoryFactory.java

示例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;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:38,代码来源:GitHubBranchRepositoryFactory.java


注:本文中的hudson.model.Job.getRootDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。