Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber
Class IncomingFileTransferRequestJabberImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.jabber.IncomingFileTransferRequestJabberImpl
All Implemented Interfaces:
IncomingFileTransferRequest

public class IncomingFileTransferRequestJabberImpl
extends Object
implements IncomingFileTransferRequest

Jabber implementation of the incoming file transfer request

Author:
Nicolas Riegel, Yana Stamcheva

Constructor Summary
IncomingFileTransferRequestJabberImpl(ProtocolProviderServiceJabberImpl jabberProvider, OperationSetFileTransferJabberImpl fileTransferOpSet, org.jivesoftware.smackx.filetransfer.FileTransferRequest fileTransferRequest)
          Creates an IncomingFileTransferRequestJabberImpl based on the given fileTransferRequest, coming from the Jabber protocol.
 
Method Summary
 FileTransfer acceptFile(File file)
          Accepts the file and starts the transfer.
 void createThumbnailListeners(String cid)
          Sets the thumbnail content-ID.
 String getFileDescription()
          Returns the description of the file corresponding to this request.
 String getFileName()
          Returns the name of the file corresponding to this request.
 long getFileSize()
          Returns the size of the file corresponding to this request.
 String getID()
          The unique id.
 Contact getSender()
          Returns the Contact making this request.
 byte[] getThumbnail()
          Returns the thumbnail contained in this request.
 void rejectFile()
          Refuses the file transfer request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncomingFileTransferRequestJabberImpl

public IncomingFileTransferRequestJabberImpl(ProtocolProviderServiceJabberImpl jabberProvider,
                                             OperationSetFileTransferJabberImpl fileTransferOpSet,
                                             org.jivesoftware.smackx.filetransfer.FileTransferRequest fileTransferRequest)
Creates an IncomingFileTransferRequestJabberImpl based on the given fileTransferRequest, coming from the Jabber protocol.

Parameters:
jabberProvider - the protocol provider
fileTransferOpSet - file transfer operation set
fileTransferRequest - the request coming from the Jabber protocol
Method Detail

getSender

public Contact getSender()
Returns the Contact making this request.

Specified by:
getSender in interface IncomingFileTransferRequest
Returns:
the Contact making this request

getFileDescription

public String getFileDescription()
Returns the description of the file corresponding to this request.

Specified by:
getFileDescription in interface IncomingFileTransferRequest
Returns:
the description of the file corresponding to this request

getFileName

public String getFileName()
Returns the name of the file corresponding to this request.

Specified by:
getFileName in interface IncomingFileTransferRequest
Returns:
the name of the file corresponding to this request

getFileSize

public long getFileSize()
Returns the size of the file corresponding to this request.

Specified by:
getFileSize in interface IncomingFileTransferRequest
Returns:
the size of the file corresponding to this request

acceptFile

public FileTransfer acceptFile(File file)
Accepts the file and starts the transfer.

Specified by:
acceptFile in interface IncomingFileTransferRequest
Parameters:
file - the file to accept
Returns:
a boolean : false if the transfer fails, true otherwise

rejectFile

public void rejectFile()
Refuses the file transfer request.

Specified by:
rejectFile in interface IncomingFileTransferRequest

getID

public String getID()
The unique id.

Specified by:
getID in interface IncomingFileTransferRequest
Returns:
the id.

getThumbnail

public byte[] getThumbnail()
Returns the thumbnail contained in this request.

Specified by:
getThumbnail in interface IncomingFileTransferRequest
Returns:
the thumbnail contained in this request

createThumbnailListeners

public void createThumbnailListeners(String cid)
Sets the thumbnail content-ID.

Parameters:
cid - the thumbnail content-ID

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.