public class

FileTransfer

extends Object
java.lang.Object
   ↳ com.gsma.services.rcs.filetransfer.FileTransfer

Class Overview

File transfer

Summary

Nested Classes
enum FileTransfer.Disposition File disposition  
enum FileTransfer.ReasonCode File transfer reason code  
enum FileTransfer.State File transfer state  
Public Methods
void abortTransfer()
Aborts the file transfer
void acceptInvitation()
Accepts file transfer invitation
String getChatId()
Returns the chat ID if this file transfer is a group file transfer
RcsService.Direction getDirection()
Returns the direction of the transfer
FileTransfer.Disposition getDisposition()
Returns the file disposition FileTransfer.Disposition.
Uri getFile()
Returns the Uri of the file
long getFileExpiration()
Returns the time for when file on the content server is no longer valid to download.
Uri getFileIcon()
Returns the Uri of the file icon
long getFileIconExpiration()
Returns the time for when file icon on the content server is no longer valid to download.
String getFileIconMimeType()
Returns the MIME type of the file icon to be transfered
String getFileName()
Returns the complete filename including the path of the file to be transferred
long getFileSize()
Returns the size of the file to be transferred
String getMimeType()
Returns the MIME type of the file to be transferred
FileTransfer.ReasonCode getReasonCode()
Returns the reason code of the state of the sharing
ContactId getRemoteContact()
Returns the remote contact identifier
FileTransfer.State getState()
Returns the state of the file transfer
long getTimestamp()
Returns the local timestamp of when the file transfer was initiated and/or queued for outgoing file transfers or the local timestamp of when the file transfer invitation was received for incoming file transfers
long getTimestampDelivered()
Returns the local timestamp of when the file transfer was delivered for outgoing file transfers or 0 for incoming file transfers or it was not yet displayed
long getTimestampDisplayed()
Returns the local timestamp of when the file transfer was displayed for outgoing file transfers or 0 for incoming file transfers or it was not yet displayed
long getTimestampSent()
Returns the local timestamp of when the file transfer was initiated and /or queued for outgoing file transfers or the remote timestamp of when the file transfer was initiated for incoming file transfers
String getTransferId()
Returns the file transfer ID of the file transfer
boolean isAllowedToPauseTransfer()
Returns true if it is possible to pause this file transfer right now, else returns false.
boolean isAllowedToResendTransfer()
Returns whether you can resend the transfer.
boolean isAllowedToResumeTransfer()
Returns true if it is possible to resume this file transfer right now, else return false.
boolean isExpiredDelivery()
Returns true if delivery for this file has expired or false otherwise.
boolean isRead()
Returns true if file transfer has been marked as read
void pauseTransfer()
Pauses the file transfer
void rejectInvitation()
Rejects file transfer invitation
void resendTransfer()
Resend a file transfer which was previously failed.
void resumeTransfer()
Resumes the file transfer
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public void abortTransfer ()

Since: API Level 1.5

Aborts the file transfer

Throws
RcsPermissionDeniedException
RcsGenericException
RcsPermissionDeniedException

public void acceptInvitation ()

Since: API Level 1.5

Accepts file transfer invitation

Throws
RcsPermissionDeniedException
RcsPersistentStorageException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException

public String getChatId ()

Since: API Level 1.5

Returns the chat ID if this file transfer is a group file transfer

Returns
  • String Chat ID
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public RcsService.Direction getDirection ()

Since: API Level 1.5

Returns the direction of the transfer

Returns
  • Direction
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public FileTransfer.Disposition getDisposition ()

Since: API Level 1.6

Returns the file disposition FileTransfer.Disposition.

Returns
  • disposition
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public Uri getFile ()

Since: API Level 1.5

Returns the Uri of the file

Returns
  • Uri of file
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getFileExpiration ()

Since: API Level 1.5

Returns the time for when file on the content server is no longer valid to download.

Returns
  • long time in milliseconds or 0 if not applicable or -1 if unknown
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public Uri getFileIcon ()

Since: API Level 1.5

Returns the Uri of the file icon

Returns
  • Uri the Uri of the file icon or thumbnail
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getFileIconExpiration ()

Since: API Level 1.5

Returns the time for when file icon on the content server is no longer valid to download.

Returns
  • long time in milliseconds or 0 if not applicable or -1 if unknown
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public String getFileIconMimeType ()

Since: API Level 1.5

Returns the MIME type of the file icon to be transfered

Returns
  • String MIME Type
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public String getFileName ()

Since: API Level 1.5

Returns the complete filename including the path of the file to be transferred

Returns
  • String Filename
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getFileSize ()

Since: API Level 1.5

Returns the size of the file to be transferred

Returns
  • long Size in bytes
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public String getMimeType ()

Since: API Level 1.5

Returns the MIME type of the file to be transferred

Returns
  • String Type
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public FileTransfer.ReasonCode getReasonCode ()

Since: API Level 1.5

Returns the reason code of the state of the sharing

Returns
  • ReasonCode
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public ContactId getRemoteContact ()

Since: API Level 1.5

Returns the remote contact identifier

Returns
  • ContactId
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public FileTransfer.State getState ()

Since: API Level 1.5

Returns the state of the file transfer

Returns
  • State
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getTimestamp ()

Since: API Level 1.5

Returns the local timestamp of when the file transfer was initiated and/or queued for outgoing file transfers or the local timestamp of when the file transfer invitation was received for incoming file transfers

Returns
  • long
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getTimestampDelivered ()

Since: API Level 1.5

Returns the local timestamp of when the file transfer was delivered for outgoing file transfers or 0 for incoming file transfers or it was not yet displayed

Returns
  • long
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getTimestampDisplayed ()

Since: API Level 1.5

Returns the local timestamp of when the file transfer was displayed for outgoing file transfers or 0 for incoming file transfers or it was not yet displayed

Returns
  • long
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public long getTimestampSent ()

Since: API Level 1.5

Returns the local timestamp of when the file transfer was initiated and /or queued for outgoing file transfers or the remote timestamp of when the file transfer was initiated for incoming file transfers

Returns
  • long
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public String getTransferId ()

Since: API Level 1.5

Returns the file transfer ID of the file transfer

Returns
  • String Transfer ID

public boolean isAllowedToPauseTransfer ()

Since: API Level 1.5

Returns true if it is possible to pause this file transfer right now, else returns false. If this filetransfer corresponds to a file transfer that is no longer present in the persistent storage false will be returned (this is no error)

Returns
  • boolean

public boolean isAllowedToResendTransfer ()

Since: API Level 1.5

Returns whether you can resend the transfer.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isAllowedToResumeTransfer ()

Since: API Level 1.5

Returns true if it is possible to resume this file transfer right now, else return false. If this filetransfer corresponds to a file transfer that is no longer present in the persistent storage false will be returned.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isExpiredDelivery ()

Since: API Level 1.5

Returns true if delivery for this file has expired or false otherwise. Note: false means either that delivery for this file has not yet expired, delivery has been successful, delivery expiration has been cleared (see clearFileTransferDeliveryExpiration) or that this particular file is not eligible for delivery expiration in the first place.

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public boolean isRead ()

Since: API Level 1.5

Returns true if file transfer has been marked as read

Returns
  • boolean
Throws
RcsPersistentStorageException
RcsGenericException
RcsPersistentStorageException

public void pauseTransfer ()

Since: API Level 1.5

Pauses the file transfer

Throws
RcsPermissionDeniedException
RcsGenericException
RcsPermissionDeniedException

public void rejectInvitation ()

Since: API Level 1.5

Rejects file transfer invitation

Throws
RcsPersistentStorageException
RcsPermissionDeniedException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException

public void resendTransfer ()

Since: API Level 1.5

Resend a file transfer which was previously failed. This only for 1-1 file transfer, an exception is thrown in case of a file transfer to group.

Throws
RcsPermissionDeniedException
RcsGenericException
RcsPermissionDeniedException

public void resumeTransfer ()

Since: API Level 1.5

Resumes the file transfer

Throws
RcsPermissionDeniedException
RcsPersistentStorageException
RcsGenericException
RcsPermissionDeniedException
RcsPersistentStorageException