Automated tool downloads are made more robust by using HTTP download retries.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23122 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-10-24 00:15:29 +00:00
1 parent 25c3bcbf29
commit fe086df945
1 file changed
+4 -1
+4 -1
View File
@@ -58,6 +58,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.fileupload.FileItem;
import org.kohsuke.stapler.Stapler;
import org.jvnet.robust_http_client.RetryableHttpStream;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -557,7 +558,9 @@ public final class FilePath implements Serializable {
if(listener!=null)
listener.getLogger().println(message);
CountingInputStream cis = new CountingInputStream(con.getInputStream());
// for HTTP downloads, enable automatic retry for added resilience
InputStream in = archive.getProtocol().equals("http") ? new RetryableHttpStream(archive) : con.getInputStream();
CountingInputStream cis = new CountingInputStream(in);
try {
if(archive.toExternalForm().endsWith(".zip"))
unzipFrom(cis);