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


Java Node.createPath方法代码示例

本文整理汇总了Java中hudson.model.Node.createPath方法的典型用法代码示例。如果您正苦于以下问题:Java Node.createPath方法的具体用法?Java Node.createPath怎么用?Java Node.createPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Node的用法示例。


在下文中一共展示了Node.createPath方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getExecutable

import hudson.model.Node; //导入方法依赖的package包/类
public static String getExecutable(String name, AppScanSourceCommand command, Node node, TaskListener listener, EnvVars env) throws IOException, InterruptedException {
    if (name != null) {
        Jenkins j = Jenkins.getInstance();
        if (j != null) {
            for (AppScanSourceInstallation tool : j.getDescriptorByType(DescriptorImpl.class).getInstallations()) {
                if (tool.getName().equals(name)) {
                    if (node != null) {
                        tool = tool.forNode(node, listener);
                    }
                    if (env != null) {
                        tool = tool.forEnvironment(env);
                    }
                    String home = Util.fixEmpty(tool.getHome());
                    if (home != null) {
                        if (node != null) {
                            FilePath homePath = node.createPath(home);
                            if (homePath != null) {
                                return homePath.child(command.getName()).getRemote();
                            }
                        }
                        return home + "/" + command.getName();
                    }
                }
            }
        }
    }
    return command.getName();
}
 
开发者ID:kevinfealey,项目名称:appscansource-scanner,代码行数:29,代码来源:AppScanSourceInstallation.java

示例2: getExecutable

import hudson.model.Node; //导入方法依赖的package包/类
public static String getExecutable(String name, AnsibleCommand command, Node node, TaskListener listener, EnvVars env) throws IOException, InterruptedException {
    if (name != null) {
        Jenkins j = Jenkins.getInstance();
        if (j != null) {
            for (AnsibleInstallation tool : j.getDescriptorByType(DescriptorImpl.class).getInstallations()) {
                if (tool.getName().equals(name)) {
                    if (node != null) {
                        tool = tool.forNode(node, listener);
                    }
                    if (env != null) {
                        tool = tool.forEnvironment(env);
                    }
                    String home = Util.fixEmpty(tool.getHome());
                    if (home != null) {
                        if (node != null) {
                            FilePath homePath = node.createPath(home);
                            if (homePath != null) {
                                return homePath.child(command.getName()).getRemote();
                            }
                        }
                        return home + "/" + command.getName();
                    }
                }
            }
        }
    }
    return command.getName();
}
 
开发者ID:jcsirot,项目名称:ansible-plugin,代码行数:29,代码来源:AnsibleInstallation.java

示例3: getExecutable

import hudson.model.Node; //导入方法依赖的package包/类
/**
 * Gets the executable name to use for a given launcher.
 * Suitable for the first item in {@link ArgumentListBuilder}.
 * @param name the name of the selected tool, or null for the default
 * @param node optionally, a node (such as a slave) on which we are running Docker
 * @param listener a listener, required in case {@code node} is not null
 * @param env optionally, environment variables to use when expanding the home directory
 * @return {@code docker} or an absolute path
 */
public static @Nonnull String getExecutable(@CheckForNull String name, @CheckForNull Node node, @Nullable TaskListener listener, @CheckForNull EnvVars env) throws IOException, InterruptedException {
    if (name != null) {
        Jenkins j = Jenkins.getInstance();
        if (j != null) {
            for (DockerTool tool : j.getDescriptorByType(DescriptorImpl.class).getInstallations()) {
                if (tool.getName().equals(name)) {
                    if (node != null) {
                        tool = tool.forNode(node, listener);
                    }
                    if (env != null) {
                        tool = tool.forEnvironment(env);
                    }
                    String home = Util.fixEmpty(tool.getHome());
                    if (home != null) {
                        if (node != null) {
                            FilePath homeFP = node.createPath(home);
                            if (homeFP != null) {
                                return homeFP.child("bin/docker").getRemote();
                            }
                        }
                        return home + "/bin/docker";
                    }
                }
            }
        }
    }
    return COMMAND;
}
 
开发者ID:jenkinsci,项目名称:docker-commons-plugin,代码行数:38,代码来源:DockerTool.java


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