當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。