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
getFile
File getFile(ByteBuffer metadata,
long offset,
long length)
throws 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:
IOException
fileCancelled
void fileCancelled(ByteBuffer metadata,
File f,
long offset,
long downloadedLength,
long requestedLength,
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 © 2010. All Rights Reserved.