Class FileTransferOfferEvent
- java.lang.Object
-
- java.util.EventObject
-
- rocks.xmpp.extensions.filetransfer.FileTransferOfferEvent
-
- All Implemented Interfaces:
Serializable,FileTransferOffer
public final class FileTransferOfferEvent extends EventObject implements FileTransferOffer
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncResult<FileTransfer>accept(File target)Accepts the inbound file transfer request.AsyncResult<FileTransfer>accept(OutputStream outputStream)Accepts the inbound file transfer request.AsyncResult<FileTransfer>accept(Path destination)Accepts the inbound file transfer request.InstantgetDate()Gets the last modification time of the file.StringgetDescription()Gets a sender-generated description of the file.List<Hash>getHashes()Gets the hashes of the file contents.JidgetInitiator()Gets the initiator.StringgetMimeType()Gets the mime type of the file.StringgetName()Gets the name of the file that the Sender wishes to send.RangegetRange()Gets the range.StringgetSessionId()longgetSize()Gets the size, in bytes, of the data to be sent.voidreject()Rejects the inbound file transfer request.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Method Detail
-
getMimeType
public String getMimeType()
Gets the mime type of the file.- Returns:
- The mime type.
-
getInitiator
public Jid getInitiator()
Gets the initiator.- Returns:
- The initiator.
-
accept
public AsyncResult<FileTransfer> accept(OutputStream outputStream)
Accepts the inbound file transfer request. After accepting the file transfer you should callFileTransfer.transfer()in order to start the transfer.- Parameters:
outputStream- The output stream, to which the file will be written.- Returns:
- The file transfer object.
-
accept
public final AsyncResult<FileTransfer> accept(Path destination) throws IOException
Accepts the inbound file transfer request. After accepting the file transfer you should callFileTransfer.transfer()in order to start the transfer.- Parameters:
destination- The path of the file to be written.- Returns:
- The file transfer object.
- Throws:
IOException- If the byte stream session could not be established.
-
accept
public final AsyncResult<FileTransfer> accept(File target) throws IOException
Accepts the inbound file transfer request. After accepting the file transfer you should callFileTransfer.transfer()in order to start the transfer.- Parameters:
target- The file to be written.- Returns:
- The file transfer object.
- Throws:
IOException- If the byte stream session could not be established.
-
reject
public void reject()
Rejects the inbound file transfer request.
-
getSize
public long getSize()
Description copied from interface:FileTransferOfferGets the size, in bytes, of the data to be sent.- Specified by:
getSizein interfaceFileTransferOffer- Returns:
- The size.
-
getName
public String getName()
Description copied from interface:FileTransferOfferGets the name of the file that the Sender wishes to send.- Specified by:
getNamein interfaceFileTransferOffer- Returns:
- The file name.
-
getDate
public Instant getDate()
Description copied from interface:FileTransferOfferGets the last modification time of the file.- Specified by:
getDatein interfaceFileTransferOffer- Returns:
- The date.
-
getHashes
public List<Hash> getHashes()
Description copied from interface:FileTransferOfferGets the hashes of the file contents.- Specified by:
getHashesin interfaceFileTransferOffer- Returns:
- The hashes.
-
getDescription
public String getDescription()
Description copied from interface:FileTransferOfferGets a sender-generated description of the file.- Specified by:
getDescriptionin interfaceFileTransferOffer- Returns:
- The description.
-
getRange
public Range getRange()
Description copied from interface:FileTransferOfferGets the range.- Specified by:
getRangein interfaceFileTransferOffer- Returns:
- The range.
-
getSessionId
public String getSessionId()
-
-