public class FileTransferManager extends Manager
createOutgoingFileTransfer(String) method.
And to recieve a file add a file transfer listener to the manager. The
listener will notify you when there is a new file transfer request. To create
the IncomingFileTransfer object accept the transfer, or, if the
transfer is not desirable reject it.
| Modifier and Type | Method and Description |
|---|---|
void |
addFileTransferListener(FileTransferListener li)
Add a file transfer listener to listen to incoming file transfer
requests.
|
protected IncomingFileTransfer |
createIncomingFileTransfer(FileTransferRequest request)
When the file transfer request is acceptable, this method should be
invoked.
|
OutgoingFileTransfer |
createOutgoingFileTransfer(String userID)
Creates an OutgoingFileTransfer to send a file to another user.
|
static FileTransferManager |
getInstanceFor(XMPPConnection connection) |
protected void |
rejectIncomingFileTransfer(FileTransferRequest request)
Reject an incoming file transfer.
|
void |
removeFileTransferListener(FileTransferListener li)
Removes a file transfer listener.
|
connectionpublic static FileTransferManager getInstanceFor(XMPPConnection connection)
public void addFileTransferListener(FileTransferListener li)
li - The listenerremoveFileTransferListener(FileTransferListener),
FileTransferListenerpublic void removeFileTransferListener(FileTransferListener li)
li - The file transfer listener to be removedFileTransferListenerpublic OutgoingFileTransfer createOutgoingFileTransfer(String userID)
userID - The fully qualified jabber ID (i.e. full JID) with resource of the user to
send the file to.IllegalArgumentException - if userID is null or not a full JIDprotected IncomingFileTransfer createIncomingFileTransfer(FileTransferRequest request)
request - The remote request that is being accepted.protected void rejectIncomingFileTransfer(FileTransferRequest request) throws SmackException.NotConnectedException
Specified in XEP-95 4.2 and 3.2 Example 8
request - SmackException.NotConnectedException