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.lang.String name, java.io.File f, long offset, long downloadedLength, long requestedLength, java.lang.Exception reason)
          Notification of a cancelled transfer.
 java.io.File getFile(java.lang.String name, long offset, long length)
           
 

Method Detail

getFile

java.io.File getFile(java.lang.String name,
                     long offset,
                     long length)
                     throws java.io.IOException
Parameters:
name - the file name (application specific)
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.lang.String name,
                   java.io.File f,
                   long offset,
                   long downloadedLength,
                   long requestedLength,
                   java.lang.Exception reason)
Notification of a cancelled transfer.

Parameters:
name - the name of the file provided by the uploader
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.