org.eclipse.ecf.filetransfer.events
Interface IFileTransferRequestEvent

All Superinterfaces:
Event, IFileTransferEvent

public interface IFileTransferRequestEvent
extends IFileTransferEvent

Event to represent remote file transfer requests. Events implementing this interface are delivered to IIncomingFileTransferRequestListener

See Also:
IIncomingFileTransferRequestListener.handleFileTransferRequest(IFileTransferRequestEvent)

Method Summary
 IIncomingFileTransfer accept(java.io.File localFileToSave)
          Accept the file transfer request.
 IIncomingFileTransfer accept(java.io.OutputStream outputStream, IFileTransferListener listener)
          Accept the file transfer request.
 IFileTransferInfo getFileTransferInfo()
          Get file transfer info associated with this file transfer request even
 ID getRequesterID()
          Get ID of remote requester
 void reject()
          Reject the file transfer request.
 boolean requestAccepted()
          If request was accepted from remote target (via successful call to accept(File)this method will return true, if rejected or failed returns false.
 

Method Detail

getRequesterID

ID getRequesterID()
Get ID of remote requester

Returns:
ID of remote requester. Will not be null.

getFileTransferInfo

IFileTransferInfo getFileTransferInfo()
Get file transfer info associated with this file transfer request even

Returns:
IFileTransfer info. Will not be null.

accept

IIncomingFileTransfer accept(java.io.File localFileToSave)
                             throws IncomingFileTransferException
Accept the file transfer request. This method should be called if the receiver of the IFileTransferRequestEvent would like to accept the file transfer request. Will not return null. Once called successfully, then requestAccepted() will return true, and further calls to accept(File) or accept(OutputStream, IFileTransferListener) will throw IncomingFileTransferExceptions.

Parameters:
localFileToSave - the file on the local file system to receive the remote file. Must not be null.
Returns:
IIncomingFileTransfer to receive file. Will not be null.
Throws:
IncomingFileTransferException - if accept message cannot be delivered back to requester

accept

IIncomingFileTransfer accept(java.io.OutputStream outputStream,
                             IFileTransferListener listener)
                             throws IncomingFileTransferException
Accept the file transfer request. This method should be called if the receiver of the IFileTransferRequestEvent would like to accept the file transfer request. Will not return null. Once called successfully, then requestAccepted() will return true, and further calls to accept(File) or accept(OutputStream, IFileTransferListener) will throw IncomingFileTransferExceptions.

Parameters:
outputStream - the output stream to receive the accepted file contents. Must not be null.
listener - for file transfer events during file reception. May be null.
Returns:
IIncomingFileTransfer to receive file. Will not be null.
Throws:
IncomingFileTransferException - if accept message cannot be delivered back to requester

reject

void reject()
Reject the file transfer request. This method should be called if the receiver of the IFileTransferRequestEvent would like to reject the file transfer request


requestAccepted

boolean requestAccepted()
If request was accepted from remote target (via successful call to accept(File)this method will return true, if rejected or failed returns false.

Returns:
true if request was accepted, false if rejected or failed