public class OperationSetFileTransferJabberImpl extends java.lang.Object implements OperationSetFileTransfer
Modifier and Type | Class and Description |
---|---|
protected static class |
OperationSetFileTransferJabberImpl.FileTransferProgressThread
Updates file transfer progress and status while sending or receiving a
file.
|
Constructor and Description |
---|
OperationSetFileTransferJabberImpl(ProtocolProviderServiceJabberImpl provider)
Constructor
|
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 |
fireFileTransferRequest(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 |
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.
|
(package private) FileTransfer |
sendFile(Contact toContact,
java.io.File file,
java.lang.String gw)
Sends a file transfer request to the given toContact.
|
public OperationSetFileTransferJabberImpl(ProtocolProviderServiceJabberImpl provider)
provider
- is the provider that created uspublic FileTransfer sendFile(Contact toContact, java.io.File file) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, OperationNotSupportedException
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 requirementsOperationNotSupportedException
- if the given contact client or
server does not support file transfersFileTransfer sendFile(Contact toContact, java.io.File file, java.lang.String gw) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, OperationNotSupportedException
toContact
- the contact that should receive the filefile
- file to sendgw
- special gateway to be used for receiver if its jid
misses the domain partjava.lang.IllegalStateException
java.lang.IllegalArgumentException
OperationNotSupportedException
public FileTransfer sendFile(Contact toContact, Contact fromContact, java.lang.String remotePath, java.lang.String localPath) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException, OperationNotSupportedException
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 requirementsOperationNotSupportedException
- if the given contact client or
server does not support file transfers.public 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 long getMaximumFileLength()
getMaximumFileLength
in interface OperationSetFileTransfer
void fireFileTransferRequest(FileTransferRequestEvent event)
event
- the EventObject that we'd like delivered to all
registered file transfer listeners.void fireFileTransferRequestRejected(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.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.