public class FileTransferManager extends Object
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.
Constructor and Description |
---|
FileTransferManager(XMPPConnection connection)
Creates a file transfer manager to initiate and receive file transfers.
|
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.
|
protected void |
fireNewRequest(StreamInitiation initiation) |
protected void |
rejectIncomingFileTransfer(FileTransferRequest request)
Reject an incoming file transfer.
|
void |
removeFileTransferListener(FileTransferListener li)
Removes a file transfer listener.
|
public FileTransferManager(XMPPConnection connection)
connection
- The XMPPConnection that the file transfers will use.public void addFileTransferListener(FileTransferListener li)
li
- The listenerremoveFileTransferListener(FileTransferListener)
,
FileTransferListener
protected void fireNewRequest(StreamInitiation initiation)
public void removeFileTransferListener(FileTransferListener li)
li
- The file transfer listener to be removedFileTransferListener
public 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