[FIXED HUDSON-3799] Fix for performance problem in FilePath.copyRecursiveTo() over the network.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@18816 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-06-11 22:38:00 +00:00
1 parent 362763ae98
commit 716f50991b
3 files changed
+27 -2

No files matched your search

+8 -1
View File
@@ -1317,7 +1317,14 @@ public final class FilePath implements Serializable {
byte[] buf = new byte[8192];
TarOutputStream tar = new TarOutputStream(new BufferedOutputStream(out));
TarOutputStream tar = new TarOutputStream(new BufferedOutputStream(out) {
// TarOutputStream uses TarBuffer internally,
// which flushes the stream for each block. this creates unnecessary
// data stream fragmentation, and flush request to a remote, which slows things down.
public void flush() throws IOException {
// so don't do anything in flush
}
});
tar.setLongFileMode(TarOutputStream.LONGFILE_GNU);
String[] files;
if(baseDir.exists()) {