public final class FileTransferManager extends Manager
createOutgoingFileTransfer(EntityFullJid)
method.
And to receive 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(org.jxmpp.jid.EntityFullJid 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.
|
connection, getAuthenticatedConnectionOrThrow, schedule
public static FileTransferManager getInstanceFor(XMPPConnection connection)
public void addFileTransferListener(FileTransferListener li)
li
- The listenerremoveFileTransferListener(FileTransferListener)
,
FileTransferListener
public void removeFileTransferListener(FileTransferListener li)
li
- The file transfer listener to be removedFileTransferListener
public OutgoingFileTransfer createOutgoingFileTransfer(org.jxmpp.jid.EntityFullJid 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, InterruptedException
Specified in XEP-95 4.2 and 3.2 Example 8
request
- SmackException.NotConnectedException
InterruptedException