提交 865f5d73 编写于 作者: K kohsuke

supported creating a launcher for a FilePath.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2573 71c3de6d-444a-0410-be80-ed276b4c234a
上级 a217a2f1
......@@ -8,6 +8,9 @@ import hudson.remoting.VirtualChannel;
import hudson.remoting.DelegatingCallable;
import hudson.util.IOException2;
import hudson.model.Hudson;
import hudson.model.TaskListener;
import hudson.Launcher.LocalLauncher;
import hudson.Launcher.RemoteLauncher;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.taskdefs.Copy;
......@@ -693,6 +696,17 @@ public final class FilePath implements Serializable {
}
}
/**
* Creates a {@link Launcher} for starting processes on the node
* that has this path.
*/
public Launcher createLauncher(TaskListener listener) {
if(channel==null)
return new LocalLauncher(listener);
else
return new RemoteLauncher(listener,channel,isUnix());
}
@Deprecated
public String toString() {
// to make writing JSPs easily, return local
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册