Class FileTransferOfferEvent

    • 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 call FileTransfer.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 call FileTransfer.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 call FileTransfer.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 interface FileTransferOffer
        Returns:
        The size.
      • getSessionId

        public String getSessionId()