public class OperationSetFileTransferIcqImpl extends java.lang.Object implements OperationSetFileTransfer, net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManagerListener
Constructor and Description |
---|
OperationSetFileTransferIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
Create a new FileTransfer OperationSet over the specified Icq provider
|
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.
|
(package private) void |
fireFileTransferCreated(FileTransferCreatedEvent event)
Delivers the file transfer to all registered listeners.
|
(package private) void |
fireFileTransferRequestCanceled(FileTransferRequestEvent event)
Delivers the specified event to all registered file transfer listeners.
|
(package private) void |
fireFileTransferRequestRejected(FileTransferRequestEvent event)
Delivers the specified event to all registered file transfer listeners.
|
long |
getMaximumFileLength()
Returns the maximum file length supported by the protocol in bytes.
|
void |
handleNewIncomingConnection(net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManager manager,
net.kano.joustsim.oscar.oscar.service.icbm.ft.IncomingRvConnection transfer)
Function called when a icq file transfer request arrive
|
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 OperationSetFileTransferIcqImpl(ProtocolProviderServiceIcqImpl icqProvider)
icqProvider
- ICQ protocol provider servicepublic 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
- the 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 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 removepublic void handleNewIncomingConnection(net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManager manager, net.kano.joustsim.oscar.oscar.service.icbm.ft.IncomingRvConnection transfer)
handleNewIncomingConnection
in interface net.kano.joustsim.oscar.oscar.service.icbm.ft.RvConnectionManagerListener
manager
- the joustsim managertransfer
- the incoming transfervoid fireFileTransferRequestRejected(FileTransferRequestEvent event)
event
- the EventObject that we'd like delivered to all
registered file transfer listeners.void fireFileTransferRequestCanceled(FileTransferRequestEvent event)
event
- the EventObject that we'd like delivered to all
registered file transfer listeners.void 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.