org.mpisws.p2p.filetransfer
Interface FileAllocationStrategy
- All Known Implementing Classes:
- TempFileAllocationStrategy
public interface FileAllocationStrategy
Tells FileTransfer where to store the bytes of a file, usually a temp file.
- Author:
- Jeff Hoye
Method Summary |
void |
fileCancelled(java.nio.ByteBuffer metadata,
java.io.File f,
long offset,
long downloadedLength,
long requestedLength,
java.lang.Exception reason)
Notification of a cancelled transfer. |
java.io.File |
getFile(java.nio.ByteBuffer metadata,
long offset,
long length)
|
getFile
java.io.File getFile(java.nio.ByteBuffer metadata,
long offset,
long length)
throws java.io.IOException
- Parameters:
metadata
- application specific, often the file namesize
- the total file sizestart
- the first byte intended to transferfinish
- the last byte intended to transfer
- Returns:
-
- Throws:
java.io.IOException
fileCancelled
void fileCancelled(java.nio.ByteBuffer metadata,
java.io.File f,
long offset,
long downloadedLength,
long requestedLength,
java.lang.Exception reason)
- Notification of a cancelled transfer.
- Parameters:
metadata
- application specific, often the file namef
- the file that was given by this strategy beforeoffset
- the beginning point in the file of this file transferdownloadedLength
- the actual "valid" downloaded lengthrequestedLength
- the length of the original file transfer request
Copyright © 2001-2005 - Rice Pastry.