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
This commit is contained in:
kohsuke committed 2007-03-22 23:30:06 +00:00
1 parent a217a2f12d
commit 865f5d736f
1 file changed
+14
+14
View File
@@ -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