Interface IFileTransferRequestEvent
-
- All Superinterfaces:
Event
,IFileTransferEvent
public interface IFileTransferRequestEvent extends IFileTransferEvent
Event to represent remote file transfer requests. Events implementing this interface are delivered toIIncomingFileTransferRequestListener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IIncomingFileTransfer
accept(File localFileToSave)
Accept the file transfer request.IIncomingFileTransfer
accept(OutputStream outputStream, IFileTransferListener listener)
Accept the file transfer request.IFileTransferInfo
getFileTransferInfo()
Get file transfer info associated with this file transfer request evenID
getRequesterID()
Get ID of remote requestervoid
reject()
Reject the file transfer request.boolean
requestAccepted()
If request was accepted from remote target (via successful call toaccept(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(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 returnnull
. Once called successfully, thenrequestAccepted()
will return true, and further calls toaccept(File)
oraccept(OutputStream, IFileTransferListener)
will throw IncomingFileTransferExceptions.- Parameters:
localFileToSave
- the file on the local file system to receive the remote file. Must not benull
.- Returns:
- IIncomingFileTransfer to receive file. Will not be
null
. - Throws:
IncomingFileTransferException
- if accept message cannot be delivered back to requester
-
accept
IIncomingFileTransfer accept(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 returnnull
. Once called successfully, thenrequestAccepted()
will return true, and further calls toaccept(File)
oraccept(OutputStream, IFileTransferListener)
will throw IncomingFileTransferExceptions.- Parameters:
outputStream
- the output stream to receive the accepted file contents. Must not benull
.listener
- for file transfer events during file reception. May benull
.- 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 toaccept(File)
this method will return true, if rejected or failed returns false.- Returns:
- true if request was accepted, false if rejected or failed
-
-