Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.protocol
Interface OperationSetFileTransfer

All Superinterfaces:
OperationSet
All Known Implementing Classes:
MockOperationSetFileTransfer, OperationSetFileTransferIcqImpl, OperationSetFileTransferJabberImpl, OperationSetFileTransferMsnImpl, OperationSetFileTransferSSHImpl, OperationSetFileTransferYahooImpl

public interface OperationSetFileTransfer
extends OperationSet

The File Transfer Operation Set provides an interface towards those functions of a given protocol, that allow transferring files among users.

Author:
Emil Ivov, Yana Stamcheva

Method Summary
 void addFileTransferListener(FileTransferListener listener)
          Adds the given FileTransferListener that would listen for file transfer requests and created file transfers.
 long getMaximumFileLength()
          Returns the maximum file length supported by the protocol in bytes.
 void removeFileTransferListener(FileTransferListener listener)
          Removes the given FileTransferListener that listens for file transfer requests and created file transfers.
 FileTransfer sendFile(Contact toContact, Contact fromContact, String remotePath, String localPath)
          Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.
 FileTransfer sendFile(Contact toContact, File file)
          Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.
 

Method Detail

sendFile

FileTransfer sendFile(Contact toContact,
                      File file)
                      throws IllegalStateException,
                             IllegalArgumentException,
                             OperationNotSupportedException
Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.

Parameters:
toContact - the contact that should receive the file
file - the file to send
Returns:
the transfer object
Throws:
IllegalStateException - if the protocol provider is not registered or connected
IllegalArgumentException - if some of the arguments doesn't fit the protocol requirements
OperationNotSupportedException - if the given contact client or server does not support file transfers

sendFile

FileTransfer sendFile(Contact toContact,
                      Contact fromContact,
                      String remotePath,
                      String localPath)
                      throws IllegalStateException,
                             IllegalArgumentException,
                             OperationNotSupportedException
Sends a file transfer request to the given toContact by specifying the local and remote file path and the fromContact, sending the file.

Parameters:
toContact - the contact that should receive the file
fromContact - the contact sending the file
remotePath - the remote file path
localPath - the local file path
Returns:
the transfer object
Throws:
IllegalStateException - if the protocol provider is not registered or connected
IllegalArgumentException - if some of the arguments doesn't fit the protocol requirements
OperationNotSupportedException - if the given contact client or server does not support file transfers.

addFileTransferListener

void addFileTransferListener(FileTransferListener listener)
Adds the given FileTransferListener that would listen for file transfer requests and created file transfers.

Parameters:
listener - the FileTransferListener to add

removeFileTransferListener

void removeFileTransferListener(FileTransferListener listener)
Removes the given FileTransferListener that listens for file transfer requests and created file transfers.

Parameters:
listener - the FileTransferListener to remove

getMaximumFileLength

long getMaximumFileLength()
Returns the maximum file length supported by the protocol in bytes.

Returns:
the file length that is supported.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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