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.Instant
getDate()
Gets the last modification time of the file.String
getDescription()
Gets a sender-generated description of the file.List<Hash>
getHashes()
Gets the hashes of the file contents.Jid
getInitiator()
Gets the initiator.String
getMimeType()
Gets the mime type of the file.String
getName()
Gets the name of the file that the Sender wishes to send.Range
getRange()
Gets the range.String
getSessionId()
long
getSize()
Gets the size, in bytes, of the data to be sent.void
reject()
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:FileTransferOffer
Gets the size, in bytes, of the data to be sent.- Specified by:
getSize
in interfaceFileTransferOffer
- Returns:
- The size.
-
getName
public String getName()
Description copied from interface:FileTransferOffer
Gets the name of the file that the Sender wishes to send.- Specified by:
getName
in interfaceFileTransferOffer
- Returns:
- The file name.
-
getDate
public Instant getDate()
Description copied from interface:FileTransferOffer
Gets the last modification time of the file.- Specified by:
getDate
in interfaceFileTransferOffer
- Returns:
- The date.
-
getHashes
public List<Hash> getHashes()
Description copied from interface:FileTransferOffer
Gets the hashes of the file contents.- Specified by:
getHashes
in interfaceFileTransferOffer
- Returns:
- The hashes.
-
getDescription
public String getDescription()
Description copied from interface:FileTransferOffer
Gets a sender-generated description of the file.- Specified by:
getDescription
in interfaceFileTransferOffer
- Returns:
- The description.
-
getRange
public Range getRange()
Description copied from interface:FileTransferOffer
Gets the range.- Specified by:
getRange
in interfaceFileTransferOffer
- Returns:
- The range.
-
getSessionId
public String getSessionId()
-
-