Rice Pastry API

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)
           
 

Method Detail

getFile

java.io.File getFile(java.nio.ByteBuffer metadata,
                     long offset,
                     long length)
                     throws java.io.IOException
Parameters:
metadata - application specific, often the file name
size - the total file size
start - the first byte intended to transfer
finish - 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 name
f - the file that was given by this strategy before
offset - the beginning point in the file of this file transfer
downloadedLength - the actual "valid" downloaded length
requestedLength - the length of the original file transfer request

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection