public final class FileTransferManager extends ExtensionManager
| Modifier and Type | Method and Description |
|---|---|
void |
addFileTransferOfferListener(FileTransferOfferListener fileTransferOfferListener)
Adds a file transfer listener, which allows to listen for inbound file transfer requests.
|
void |
fileTransferOffered(IQ iq,
String sessionId,
String mimeType,
FileTransferOffer fileTransferOffer,
Object protocol,
FileTransferNegotiator fileTransferNegotiator) |
FileTransfer |
offerFile(File file,
String description,
Jid recipient,
long timeout)
Offers a file to another user.
|
FileTransfer |
offerFile(InputStream source,
String fileName,
long fileSize,
Date lastModified,
String description,
Jid recipient,
long timeout)
Offers a stream to another user.
|
FileTransfer |
offerFile(Path source,
String description,
Jid recipient,
long timeout)
Offers a file to another user.
|
void |
offerFile(URL url,
String description,
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.
|
isEnabled, setEnabledpublic void offerFile(URL url, String description, Jid recipient, long timeout) throws 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.StanzaException - If the user is unavailable or failed to download the file.NoResponseException - If the recipient did not downloaded the file within the timeout.XmppExceptionpublic final FileTransfer offerFile(File file, String description, Jid recipient, long timeout) throws 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, i. e. including resource).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.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.XmppExceptionpublic final FileTransfer offerFile(Path source, String description, Jid recipient, long timeout) throws XmppException, IOException
FileTransfer.transfer() to start the file transfer.source - The file.description - The description of the file.recipient - The recipient's JID (must be a full JID, i. e. including resource).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.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.XmppExceptionpublic final FileTransfer offerFile(InputStream source, String fileName, long fileSize, Date lastModified, String description, Jid recipient, long timeout) throws XmppException, IOException
FileTransfer.transfer() to start the file transfer.source - The stream.fileName - The file name.fileSize - The file size.lastModified - The last modified date.description - The description of the file.recipient - The recipient's JID (must be a full JID, i. e. including resource).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.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.XmppExceptionpublic void fileTransferOffered(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–2015 XMPP.rocks. All rights reserved.