public final class FileTransferManager extends ExtensionManager
features, xmppSession| Modifier and Type | Method and Description |
|---|---|
void |
addFileTransferOfferListener(FileTransferOfferListener fileTransferOfferListener)
Adds a file transfer listener, which allows to listen for incoming file transfer requests.
|
void |
fileTransferOffered(rocks.xmpp.core.stanza.model.client.IQ iq,
String sessionId,
String mimeType,
FileTransferOffer fileTransferOffer,
Object protocol,
FileTransferNegotiator fileTransferNegotiator) |
FileTransfer |
offerFile(File file,
String description,
rocks.xmpp.core.Jid recipient,
long timeout)
Offers a file to another user.
|
void |
offerFile(URL url,
String description,
rocks.xmpp.core.Jid recipient,
long timeout)
Offers a file to another user in form of an URL.
|
void |
removeFileTransferOfferListener(FileTransferOfferListener fileTransferOfferListener)
Removes a previously added file transfer listener.
|
setEnabledpublic void offerFile(URL url, String description, rocks.xmpp.core.Jid recipient, long timeout) throws rocks.xmpp.core.XmppException
url - The URL of the file.description - The description of the file.recipient - The recipient's JID (must be a full JID).timeout - The timeout (indicates how long to wait until the file has been downloaded).FileTransferRejectedException - If the recipient rejected the file.rocks.xmpp.core.stanza.model.StanzaException - If the user is unavailable or failed to download the file.NoResponseException - If the recipient did not downloaded the file within the timeout.rocks.xmpp.core.XmppExceptionpublic FileTransfer offerFile(File file, String description, rocks.xmpp.core.Jid recipient, long timeout) throws rocks.xmpp.core.XmppException, IOException
FileTransfer.transfer() to start the file transfer.file - The file.description - The description of the file.recipient - The recipient's JID (must be a full JID).timeout - The timeout (indicates how long to wait until the file offer has either been accepted or rejected).FileTransferRejectedException - If the recipient rejected the file.rocks.xmpp.core.stanza.model.StanzaException - If the user is unavailable or failed to download the file.NoResponseException - If the recipient did not downloaded the file within the timeout.IOException - If the file could not be read.rocks.xmpp.core.XmppExceptionpublic void fileTransferOffered(rocks.xmpp.core.stanza.model.client.IQ iq, String sessionId, String mimeType, FileTransferOffer fileTransferOffer, Object protocol, FileTransferNegotiator fileTransferNegotiator)
public void addFileTransferOfferListener(FileTransferOfferListener fileTransferOfferListener)
fileTransferOfferListener - The listener.removeFileTransferOfferListener(FileTransferOfferListener)public void removeFileTransferOfferListener(FileTransferOfferListener fileTransferOfferListener)
fileTransferOfferListener - The listener.addFileTransferOfferListener(FileTransferOfferListener)Copyright © 2014 XMPP.rocks. All rights reserved.