public class MockOperationSetFileTransfer extends java.lang.Object implements OperationSetFileTransfer
Constructor and Description |
---|
MockOperationSetFileTransfer(MockProvider protocolProvider) |
Modifier and Type | Method and Description |
---|---|
void |
addFileTransferListener(FileTransferListener listener)
Adds the given FileTransferListener that would listen for
file transfer requests and created file transfers.
|
void |
changeFileTransferStatus(FileTransfer ft,
int newstatus) |
(package private) void |
fireFileTransferCreated(FileTransferCreatedEvent event)
Delivers the file transfer to all registered listeners.
|
long |
getMaximumFileLength()
Returns the maximum file length supported by the protocol in bytes.
|
void |
receiveFile(java.io.File file,
Contact from) |
void |
removeFileTransferListener(FileTransferListener listener)
Removes the given FileTransferListener that listens for
file transfer requests and created file transfers.
|
FileTransfer |
sendFile(Contact toContact,
Contact fromContact,
java.lang.String remotePath,
java.lang.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,
java.io.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.
|
public MockOperationSetFileTransfer(MockProvider protocolProvider)
public FileTransfer sendFile(Contact toContact, java.io.File file) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
sendFile
in interface OperationSetFileTransfer
toContact
- the contact that should receive the filefile
- file to sendjava.lang.IllegalStateException
- if the protocol provider is not registered
or connectedjava.lang.IllegalArgumentException
- if some of the arguments doesn't fit the
protocol requirementspublic void changeFileTransferStatus(FileTransfer ft, int newstatus)
public void receiveFile(java.io.File file, Contact from)
public FileTransfer sendFile(Contact toContact, Contact fromContact, java.lang.String remotePath, java.lang.String localPath) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
sendFile
in interface OperationSetFileTransfer
toContact
- the contact that should receive the filefromContact
- the contact sending the fileremotePath
- the remote file pathlocalPath
- the local file pathjava.lang.IllegalStateException
- if the protocol provider is not registered
or connectedjava.lang.IllegalArgumentException
- if some of the arguments doesn't fit the
protocol requirementspublic void addFileTransferListener(FileTransferListener listener)
addFileTransferListener
in interface OperationSetFileTransfer
listener
- the FileTransferListener to addpublic void removeFileTransferListener(FileTransferListener listener)
removeFileTransferListener
in interface OperationSetFileTransfer
listener
- the FileTransferListener to removevoid fireFileTransferCreated(FileTransferCreatedEvent event)
event
- the FileTransferEvent that we'd like delivered to
all registered file transfer listeners.public long getMaximumFileLength()
getMaximumFileLength
in interface OperationSetFileTransfer
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.