java.lang.Object | ||
↳ | com.gsma.services.rcs.RcsService | |
↳ | com.gsma.services.rcs.filetransfer.FileTransferService |
This class offers the main entry point to transfer files and to receive files. Several applications may connect/disconnect to the API. The parameter contact in the API supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.gsma.services.rcs.RcsService
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FileTransferService(Context ctx, RcsServiceListener listener)
Constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addEventListener(GroupFileTransferListener listener)
Adds a listener on group file transfer events
| ||||||||||
void |
addEventListener(OneToOneFileTransferListener listener)
Adds a listener on file transfer events
| ||||||||||
void |
clearFileTransferDeliveryExpiration(Set<String> transferIds)
Disables and clears any delivery expiration for a set of file transfers regardless if the
delivery of them has expired already or not.
| ||||||||||
final void |
connect()
Connects to the API
| ||||||||||
void |
deleteFileTransfer(String transferId)
Deletes a file transfer by its unique id from history and abort/reject any associated ongoing
session if such exists.
| ||||||||||
void |
deleteGroupFileTransfers()
Deletes all group file transfer from history and abort/reject any associated ongoing session
if such exists.
| ||||||||||
void |
deleteGroupFileTransfers(String chatId)
Deletes file transfer corresponding to a given group chat specified by chat id from history
and abort/reject any associated ongoing session if such exists.
| ||||||||||
void |
deleteOneToOneFileTransfers(ContactId contact)
Deletes file transfer corresponding to a given one to one chat specified by contact from
history and abort/reject any associated ongoing session if such exists.
| ||||||||||
void |
deleteOneToOneFileTransfers()
Deletes all one to one file transfer from history and abort/reject any associated ongoing
session if such exists.
| ||||||||||
void |
disconnect()
Disconnects from the API
| ||||||||||
FileTransferServiceConfiguration |
getConfiguration()
Returns the configuration of the file transfer service
| ||||||||||
FileTransfer |
getFileTransfer(String transferId)
Returns a current file transfer from its unique ID
| ||||||||||
boolean |
isAllowedToTransferFile(ContactId contact)
Returns true if it is possible to initiate file transfer to the contact specified by the
contact parameter, else returns false.
| ||||||||||
boolean |
isAllowedToTransferFileToGroupChat(String chatId)
Returns true if it is possible to initiate file transfer to the group chat specified by the
chatId parameter, else returns false.
| ||||||||||
void |
markFileTransferAsRead(String transferId)
Mark a received file transfer as read (i.e.
| ||||||||||
void |
removeEventListener(GroupFileTransferListener listener)
Removes a listener on group file transfer events
| ||||||||||
void |
removeEventListener(OneToOneFileTransferListener listener)
Removes a listener on file transfer events
| ||||||||||
FileTransfer |
transferFile(ContactId contact, Uri file, boolean attachFileIcon)
This method is deprecated.
Use
transferFile(ContactId, Uri, Disposition, boolean)
instead. | ||||||||||
FileTransfer |
transferFile(ContactId contact, Uri file, FileTransfer.Disposition disposition, boolean attachFileIcon)
Transfers a file to a contact.
| ||||||||||
FileTransfer |
transferFileToGroupChat(String chatId, Uri file, boolean attachFileIcon)
This method is deprecated.
Use
transferFileToGroupChat(String, Uri, Disposition, boolean)
instead. | ||||||||||
FileTransfer |
transferFileToGroupChat(String chatId, Uri file, FileTransfer.Disposition disposition, boolean attachFileIcon)
Transfers a file to a group chat with an optional file icon.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.gsma.services.rcs.RcsService
| |||||||||||
From class
java.lang.Object
|
Constructor
ctx | Application context |
---|---|
listener | Service listener |
Adds a listener on group file transfer events
listener | Group file transfer listener |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Adds a listener on file transfer events
listener | One-to-one file transfer listener |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Disables and clears any delivery expiration for a set of file transfers regardless if the delivery of them has expired already or not.
transferIds | the file transfer IDs |
---|
RcsServiceNotAvailableException | |
RcsPersistentStorageException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Connects to the API
RcsPermissionDeniedException |
---|
Deletes a file transfer by its unique id from history and abort/reject any associated ongoing session if such exists.
transferId | the file transfer ID |
---|
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Deletes all group file transfer from history and abort/reject any associated ongoing session if such exists.
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Deletes file transfer corresponding to a given group chat specified by chat id from history and abort/reject any associated ongoing session if such exists.
chatId | the chat ID |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Deletes file transfer corresponding to a given one to one chat specified by contact from history and abort/reject any associated ongoing session if such exists.
contact | the remote contact |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Deletes all one to one file transfer from history and abort/reject any associated ongoing session if such exists.
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Returns the configuration of the file transfer service
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Returns a current file transfer from its unique ID
transferId | the file transfer ID |
---|
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Returns true if it is possible to initiate file transfer to the contact specified by the contact parameter, else returns false.
contact | the remote contact |
---|
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Returns true if it is possible to initiate file transfer to the group chat specified by the chatId parameter, else returns false.
chatId | the chat ID |
---|
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Mark a received file transfer as read (i.e. the invitation or the file has been displayed in the UI).
transferId | the file transfer ID |
---|
RcsServiceNotAvailableException | |
RcsPersistentStorageException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Removes a listener on group file transfer events
listener | Group file transfer listener |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
Removes a listener on file transfer events
listener | File transfer listener |
---|
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsServiceNotAvailableException |
This method is deprecated.
Use
transferFile(ContactId, Uri, Disposition, boolean)
instead.
Transfers a file to a contact. The parameter file contains the URI of the file to be transferred (for a local or a remote file). The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.
contact | the remote contact Identifier |
---|---|
file | Uri of file to transfer |
attachFileIcon | File icon option. If true, the stack tries to attach fileicon. Fileicon may not be attached if file is not an image or if local or remote contact does not support fileicon. |
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Transfers a file to a contact. The parameter file contains the URI of the file to be transferred (for a local or a remote file). The parameter contact supports the following formats: MSISDN in national or international format, SIP address, SIP-URI or Tel-URI. If the format of the contact is not supported an exception is thrown.
contact | the remote contact Identifier |
---|---|
file | Uri of file to transfer |
disposition | File disposition |
attachFileIcon | File icon option. If true, the stack tries to attach fileicon. Fileicon may not be attached if file is not an image or if local or remote contact does not support fileicon. |
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
This method is deprecated.
Use
transferFileToGroupChat(String, Uri, Disposition, boolean)
instead.
Transfers a file to a group chat with an optional file icon.
chatId | the chat ID |
---|---|
file | Uri of file to transfer |
attachFileIcon | Attach file icon option. If true, the stack tries to attach fileIcon. FileIcon may not be attached if file is not an image or if local or remote contact does not support fileIcon. |
RcsPermissionDeniedException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPermissionDeniedException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |
Transfers a file to a group chat with an optional file icon.
chatId | the chat ID |
---|---|
file | Uri of file to transfer |
disposition | File disposition |
attachFileIcon | Attach file icon option. If true, the stack tries to attach fileIcon. FileIcon may not be attached if file is not an image or if local or remote contact does not support fileIcon. |
RcsPermissionDeniedException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException | |
RcsGenericException | |
RcsPermissionDeniedException | |
RcsPersistentStorageException | |
RcsServiceNotAvailableException |