Chat SDK for Android v1.2.1
agora java chat SDK
Classes | Public Member Functions | List of all members
io.agora.chat.FileMessageBody Class Referenceabstract
Inheritance diagram for io.agora.chat.FileMessageBody:
io.agora.chat.MessageBody io.agora.chat.ImageMessageBody io.agora.chat.NormalFileMessageBody io.agora.chat.VideoMessageBody io.agora.chat.VoiceMessageBody

Classes

enum  EMDownloadStatus
 

Public Member Functions

 FileMessageBody (String localPath)
 
 FileMessageBody (Uri localPath)
 
String getFileName ()
 
void setFileName (String fileName)
 
String getLocalUrl ()
 
void setLocalUrl (String localUrl)
 
Uri getLocalUri ()
 
void setLocalUrl (Uri localUrl)
 
String getRemoteUrl ()
 
void setRemoteUrl (String remoteUrl)
 
void setSecret (String secret)
 
String getSecret ()
 
String displayName ()
 
void setFileLength (long length)
 
EMDownloadStatus downloadStatus ()
 
void setDownloadStatus (EMDownloadStatus status)
 
- Public Member Functions inherited from io.agora.chat.MessageBody
long operationTime ()
 
String operatorId ()
 
int operationCount ()
 

Detailed Description

The base class of file type message.

Constructor & Destructor Documentation

◆ FileMessageBody() [1/2]

io.agora.chat.FileMessageBody.FileMessageBody ( String  localPath)

The constructor method of the file message body.

Parameters
localPathThe absolute path to the attachment file or the path to the URI as a string.

◆ FileMessageBody() [2/2]

io.agora.chat.FileMessageBody.FileMessageBody ( Uri  localPath)

The constructor method of the file message body.

Parameters
localPathThe localPath URI of the attachment file.

Member Function Documentation

◆ displayName()

String io.agora.chat.FileMessageBody.displayName ( )

Gets the filename.

Returns
The filename.

◆ downloadStatus()

EMDownloadStatus io.agora.chat.FileMessageBody.downloadStatus ( )

Gets the download status of the attachment file.

Returns
The download status of the attachment file.

The SDK is downloading the file message.

The SDK successfully downloads the file message.

The SDK fails to download the file message.

File message download is pending.

This state is deprecated. Use EMDownloadStatusSucceed instead.

◆ getFileName()

String io.agora.chat.FileMessageBody.getFileName ( )

Gets the file name.

Returns
The file name.

Reimplemented in io.agora.chat.ImageMessageBody.

◆ getLocalUri()

Uri io.agora.chat.FileMessageBody.getLocalUri ( )

Gets the URI of the local image, voice and so on.

Returns
The URI of the local image, voice and so on.

◆ getLocalUrl()

String io.agora.chat.FileMessageBody.getLocalUrl ( )

The local path or the string in the form of URI of the file.

Returns
The local file path or the string form of URI.

◆ getRemoteUrl()

String io.agora.chat.FileMessageBody.getRemoteUrl ( )

Gets the path of the attachment file in the server.

Returns
The path of the attachment file in the server.

◆ getSecret()

String io.agora.chat.FileMessageBody.getSecret ( )

Gets the token for downloading the message attachment.

Returns
The file token generated by the server。

◆ setDownloadStatus()

void io.agora.chat.FileMessageBody.setDownloadStatus ( EMDownloadStatus  status)

Sets the download status of the attachment file.

Parameters
statusThe downloading status of the attachment file.

◆ setFileLength()

void io.agora.chat.FileMessageBody.setFileLength ( long  length)

Sets the data length (bytes) of the attachment file.

Parameters
lengthThe data length (bytes) of the attachment file.

◆ setFileName()

void io.agora.chat.FileMessageBody.setFileName ( String  fileName)

Sets the file name.

Parameters
fileNameThe file name.

◆ setLocalUrl() [1/2]

void io.agora.chat.FileMessageBody.setLocalUrl ( String  localUrl)

Sets the local path of the file.

Parameters
localUrlThe absolute path to the file or the string form of URI.

◆ setLocalUrl() [2/2]

void io.agora.chat.FileMessageBody.setLocalUrl ( Uri  localUrl)

Sets the URI of the local file.

Parameters
localUrlThe URI of file.

◆ setRemoteUrl()

void io.agora.chat.FileMessageBody.setRemoteUrl ( String  remoteUrl)

Sets the path of the attachment file in the server.

Parameters
remoteUrlThe path of the attachment file in the server.

◆ setSecret()

void io.agora.chat.FileMessageBody.setSecret ( String  secret)

Sets the file's token, this method is typically invoked by the SDK.

Parameters
secretThe file's token.

The documentation for this class was generated from the following file: