Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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

All Known Implementing Classes:
AbstractFileTransfer, FileTransferImpl, FileTransferImpl, FileTransferImpl, FileTransferSSHImpl, IncomingFileTransferJabberImpl, MockFileTransferImpl, OutgoingFileTransferJabberImpl

public interface FileTransfer

The FileTransfer interface is meant to be used by parties interested in the file transfer process. It contains information about the status and the progress of the transfer as well as the bytes that have been transfered.

Author:
Yana Stamcheva

Field Summary
static int IN
          File transfer is incoming.
static int OUT
          File transfer is outgoing.
 
Method Summary
 void addProgressListener(FileTransferProgressListener listener)
          Adds the given FileTransferProgressListener to listen for status changes on this file transfer.
 void addStatusListener(FileTransferStatusListener listener)
          Adds the given FileTransferStatusListener to listen for status changes on this file transfer.
 void cancel()
          Cancels this file transfer.
 Contact getContact()
          Returns the contact that we are transfering files with.
 int getDirection()
          The file transfer direction.
 String getID()
          Uniquie ID that is identifying the FileTransfer if the request has been accepted.
 File getLocalFile()
          Returns the local file that is being transferred or to which we transfer.
 int getStatus()
          Returns the current status of the transfer.
 long getTransferedBytes()
          Returns the number of bytes already transfered through this file transfer.
 void removeProgressListener(FileTransferProgressListener listener)
          Removes the given FileTransferProgressListener.
 void removeStatusListener(FileTransferStatusListener listener)
          Removes the given FileTransferStatusListener.
 

Field Detail

IN

static final int IN
File transfer is incoming.

See Also:
Constant Field Values

OUT

static final int OUT
File transfer is outgoing.

See Also:
Constant Field Values
Method Detail

getID

String getID()
Uniquie ID that is identifying the FileTransfer if the request has been accepted.

Returns:
the id.

cancel

void cancel()
Cancels this file transfer. When this method is called transfer should be interrupted.


getDirection

int getDirection()
The file transfer direction.

Returns:
returns the direction of the file transfer : IN or OUT.

getLocalFile

File getLocalFile()
Returns the local file that is being transferred or to which we transfer.

Returns:
the file

getContact

Contact getContact()
Returns the contact that we are transfering files with.

Returns:
the contact.

getStatus

int getStatus()
Returns the current status of the transfer. This information could be used from the user interface to show the current status of the transfer. The status is returned as an int and could be equal to one of the static constants declared in this interface (i.e. COMPLETED, CANCELED, FAILED, etc.).

Returns:
the current status of the transfer

getTransferedBytes

long getTransferedBytes()
Returns the number of bytes already transfered through this file transfer.

Returns:
the number of bytes already transfered through this file transfer

addStatusListener

void addStatusListener(FileTransferStatusListener listener)
Adds the given FileTransferStatusListener to listen for status changes on this file transfer.

Parameters:
listener - the listener to add

removeStatusListener

void removeStatusListener(FileTransferStatusListener listener)
Removes the given FileTransferStatusListener.

Parameters:
listener - the listener to remove

addProgressListener

void addProgressListener(FileTransferProgressListener listener)
Adds the given FileTransferProgressListener to listen for status changes on this file transfer.

Parameters:
listener - the listener to add

removeProgressListener

void removeProgressListener(FileTransferProgressListener listener)
Removes the given FileTransferProgressListener.

Parameters:
listener - the listener to remove

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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