提交 9808c4c5 编写于 作者: K kohsuke

improved error diagnostics

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19708 71c3de6d-444a-0410-be80-ed276b4c234a
上级 1eb54187
......@@ -55,6 +55,7 @@ import org.apache.tools.tar.TarEntry;
import org.apache.tools.zip.ZipOutputStream;
import org.apache.tools.zip.ZipEntry;
import org.apache.commons.io.IOUtils;
import org.apache.commons.io.input.CountingInputStream;
import org.apache.commons.fileupload.FileItem;
import org.kohsuke.stapler.Stapler;
......@@ -555,10 +556,17 @@ public final class FilePath implements Serializable {
if(listener!=null)
listener.getLogger().println(message);
if(archive.toExternalForm().endsWith(".zip"))
unzipFrom(con.getInputStream());
CountingInputStream cis = new CountingInputStream(con.getInputStream());
try {
if(archive.toExternalForm().endsWith(".zip"))
unzipFrom(cis);
else
untarFrom(con.getInputStream(),GZIP);
untarFrom(cis,GZIP);
} catch (IOException e) {
throw new IOException2(String.format("Failed to unpack %s (%d bytes read of total %d)",
archive,cis.getByteCount(),con.getContentLength()),e);
}
timestamp.touch(sourceTimestamp);
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册