private class SnapPuller.FileFetcher
extends java.lang.Object
ReplicationHandler.FileStream
Modifier and Type | Field and Description |
---|---|
private boolean |
aborted |
(package private) byte[] |
buf |
(package private) long |
bytesDownloaded |
(package private) java.util.zip.Checksum |
checksum |
private java.io.File |
copy2Dir |
(package private) int |
errorCount |
(package private) java.io.File |
file |
(package private) java.nio.channels.FileChannel |
fileChannel |
(package private) java.lang.String |
fileName |
private java.io.FileOutputStream |
fileOutputStream |
(package private) boolean |
includeChecksum |
private java.lang.Long |
indexVersion |
private boolean |
isConf |
(package private) long |
lastmodified |
private org.apache.commons.httpclient.methods.PostMethod |
post |
(package private) java.lang.String |
saveAs |
(package private) long |
size |
Constructor and Description |
---|
FileFetcher(java.io.File dir,
java.util.Map<java.lang.String,java.lang.Object> fileDetails,
java.lang.String saveAs,
boolean isConf,
long latestVersion) |
Modifier and Type | Method and Description |
---|---|
private void |
cleanup()
cleanup everything
|
(package private) void |
fetchFile()
The main method which downloads file
|
private int |
fetchPackets(FastInputStream fis) |
(package private) FastInputStream |
getStream()
Open a new stream using HttpClient
|
private int |
readInt(byte[] b)
The webcontainer flushes the data only after it fills the buffer size.
|
private long |
readLong(byte[] b)
Same as above but to read longs from a byte array
|
boolean includeChecksum
private java.io.File copy2Dir
java.lang.String fileName
java.lang.String saveAs
long size
long lastmodified
long bytesDownloaded
java.nio.channels.FileChannel fileChannel
private java.io.FileOutputStream fileOutputStream
byte[] buf
java.util.zip.Checksum checksum
java.io.File file
int errorCount
private boolean isConf
private org.apache.commons.httpclient.methods.PostMethod post
private boolean aborted
private java.lang.Long indexVersion
FileFetcher(java.io.File dir, java.util.Map<java.lang.String,java.lang.Object> fileDetails, java.lang.String saveAs, boolean isConf, long latestVersion) throws java.io.IOException
java.io.IOException
void fetchFile() throws java.lang.Exception
java.lang.Exception
private int fetchPackets(FastInputStream fis) throws java.lang.Exception
java.lang.Exception
private int readInt(byte[] b)
private long readLong(byte[] b)
private void cleanup()
FastInputStream getStream() throws java.io.IOException
java.io.IOException