Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.mock
Class MockFileTransferImpl

java.lang.Object
  extended by net.java.sip.communicator.service.protocol.AbstractFileTransfer
      extended by net.java.sip.communicator.impl.protocol.mock.MockFileTransferImpl
All Implemented Interfaces:
FileTransfer

public class MockFileTransferImpl
extends AbstractFileTransfer

Author:
Damian Minkov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.protocol.FileTransfer
IN, OUT
 
Constructor Summary
MockFileTransferImpl(Contact c, File file, String id, int direction)
           
 
Method Summary
 void cancel()
          Cancels this file transfer.
 void fireStatusChangeEvent(int newStatus)
          Notifies all status listeners that a new FileTransferStatusChangeEvent occured.
 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.
 long getTransferedBytes()
          Returns the number of bytes already transfered through this file transfer.
 
Methods inherited from class net.java.sip.communicator.service.protocol.AbstractFileTransfer
addProgressListener, addStatusListener, fireProgressChangeEvent, fireStatusChangeEvent, getStatus, removeProgressListener, removeStatusListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFileTransferImpl

public MockFileTransferImpl(Contact c,
                            File file,
                            String id,
                            int direction)
Method Detail

fireStatusChangeEvent

public void fireStatusChangeEvent(int newStatus)
Notifies all status listeners that a new FileTransferStatusChangeEvent occured.

Overrides:
fireStatusChangeEvent in class AbstractFileTransfer
Parameters:
newStatus - the new status

cancel

public void cancel()
Description copied from class: AbstractFileTransfer
Cancels this file transfer. When this method is called transfer should be interrupted.

Specified by:
cancel in interface FileTransfer
Specified by:
cancel in class AbstractFileTransfer

getTransferedBytes

public long getTransferedBytes()
Description copied from class: AbstractFileTransfer
Returns the number of bytes already transfered through this file transfer.

Specified by:
getTransferedBytes in interface FileTransfer
Specified by:
getTransferedBytes in class AbstractFileTransfer
Returns:
the number of bytes already transfered through this file transfer

getID

public String getID()
Description copied from interface: FileTransfer
Uniquie ID that is identifying the FileTransfer if the request has been accepted.

Returns:
the id.

getDirection

public int getDirection()
Description copied from interface: FileTransfer
The file transfer direction.

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

getLocalFile

public File getLocalFile()
Description copied from interface: FileTransfer
Returns the local file that is being transferred or to which we transfer.

Returns:
the file

getContact

public Contact getContact()
Description copied from interface: FileTransfer
Returns the contact that we are transfering files with.

Returns:
the contact.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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