Class FileTransferManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.filetransfer.FileTransferManager
-
public final class FileTransferManager extends Manager
The file transfer manager class handles the sending and receiving of files. To send a file invoke thecreateOutgoingFileTransfer(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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFileTransferListener(FileTransferListener li)
Add a file transfer listener to listen to incoming file transfer requests.OutgoingFileTransfer
createOutgoingFileTransfer(EntityFullJid userID)
Creates an OutgoingFileTransfer to send a file to another user.static FileTransferManager
getInstanceFor(XMPPConnection connection)
void
removeFileTransferListener(FileTransferListener li)
Removes a file transfer listener.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static FileTransferManager getInstanceFor(XMPPConnection connection)
-
addFileTransferListener
public void addFileTransferListener(FileTransferListener li)
Add a file transfer listener to listen to incoming file transfer requests.- Parameters:
li
- TODO javadoc me please The listener- See Also:
removeFileTransferListener(FileTransferListener)
,FileTransferListener
-
removeFileTransferListener
public void removeFileTransferListener(FileTransferListener li)
Removes a file transfer listener.- Parameters:
li
- TODO javadoc me please The file transfer listener to be removed- See Also:
FileTransferListener
-
createOutgoingFileTransfer
public OutgoingFileTransfer createOutgoingFileTransfer(EntityFullJid userID)
Creates an OutgoingFileTransfer to send a file to another user.- Parameters:
userID
- TODO javadoc me please The fully qualified jabber ID (i.e. full JID) with resource of the user to send the file to.- Returns:
- The send file object on which the negotiated transfer can be run.
- Throws:
IllegalArgumentException
- if userID is null or not a full JID
-
-