提交 f4134339 编写于 作者: K kohsuke

another convenience method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13176 71c3de6d-444a-0410-be80-ed276b4c234a
上级 7b8aee67
......@@ -11,6 +11,7 @@ import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.net.URL;
import org.apache.commons.io.IOUtils;
......@@ -33,6 +34,14 @@ public class SingleFileSCM extends NullSCM {
this.contents = contents.getBytes(Charset.forName("UTF-8"));
}
/**
* When a check out is requested, serve the contents of the URL and place it with the given path name.
*/
public SingleFileSCM(String path, URL resource) throws IOException {
this.path = path;
this.contents = IOUtils.toByteArray(resource.openStream());
}
@Override
public boolean checkout(AbstractBuild build, Launcher launcher, FilePath workspace, BuildListener listener, File changeLogFile) throws IOException, InterruptedException {
listener.getLogger().println("Staging "+path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册