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()StringgetDescription()List<Hash>getHashes()JidgetInitiator()Gets the initiator.StringgetMimeType()Gets the mime type of the file.StringgetName()RangegetRange()StringgetSessionId()longgetSize()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()
- Specified by:
getSizein interfaceFileTransferOffer
-
getName
public String getName()
- Specified by:
getNamein interfaceFileTransferOffer
-
getDate
public Instant getDate()
- Specified by:
getDatein interfaceFileTransferOffer
-
getHashes
public List<Hash> getHashes()
- Specified by:
getHashesin interfaceFileTransferOffer
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceFileTransferOffer
-
getRange
public Range getRange()
- Specified by:
getRangein interfaceFileTransferOffer
-
getSessionId
public String getSessionId()
-
-