public final class FileMessage extends BaseMessage
Modifier and Type | Class and Description |
---|---|
static class |
FileMessage.RequestState
Deprecated.
As of 3.0.120, replaced by
SendingStatus . |
static class |
FileMessage.Thumbnail
Represents image thumbnail.
|
static class |
FileMessage.ThumbnailSize
Represents image thumbnail size.
|
BaseMessage.GetMessageHandler, BaseMessage.GetThreadedMessagesHandler, BaseMessage.SendingStatus
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessage()
Returns message text.
|
FileMessageParams |
getMessageParams()
returns FileMessageParams object that used for sending this message
It's not null when sendingStatus is
SendingStatus#PENDING or SendingStatus#FAILED or SendingStatus#CANCELED
If else, it will return null |
java.lang.String |
getName()
Returns name of the file.
|
java.lang.String |
getPlainUrl()
Returns the plain file URL, which does not contain
SendBird.getEkey() as a parameter. |
java.util.List<java.lang.String> |
getRequestedMentionUserIds()
Returns requested mention user ids.
|
java.lang.String |
getRequestId()
Returns a file request ID.
|
FileMessage.RequestState |
getRequestState()
Deprecated.
As of 3.0.120, replaced by
BaseMessage.getSendingStatus() . |
int |
getSize()
Returns size of the file.
|
java.util.List<FileMessage.Thumbnail> |
getThumbnails()
Returns the thumbnail information of image file.
|
java.lang.String |
getType()
Returns the type of the file.
|
java.lang.String |
getUrl()
Returns the file URL.
|
java.lang.String |
toString() |
applyParentMessage, applyReactionEvent, applyThreadInfoUpdateEvent, belongsTo, belongsTo, buildFromSerializedData, buildFromSerializedData, clone, equals, getAllMetaArray, getAllMetaArrays, getAppleCriticalAlertOptions, getChannelUrl, getCreatedAt, getCustomType, getData, getErrorCode, getMentionedMessageTemplate, getMentionedUsers, getMentionType, getMessage, getMessageId, getMessageSurvivalSeconds, getMetaArray, getMetaArrays, getOgMetaData, getParentMessage, getParentMessageId, getParentMessageText, getReactions, getSender, getSendingStatus, getThreadedMessagesByTimestamp, getThreadInfo, getUpdatedAt, hashCode, isGroupChannel, isOpenChannel, isOperatorMessage, isReplyToChannel, isResendable, isSilent, serialize, setAppleCriticalAlertOptions
public java.lang.String getMessage()
getMessage
in class BaseMessage
public java.lang.String getRequestId()
getRequestId
in class BaseMessage
public java.lang.String getUrl()
If you enabled the file encryption feature and want to cache the file with URL string as a
key, it is recommended to use getPlainUrl()
instead. This is because the URL
returned by this method embeds SendBird.getEkey()
, which changes at every login,
leading to a frequent cache miss.
getPlainUrl()
public java.lang.String getPlainUrl()
SendBird.getEkey()
as a parameter.
If the file encryption feature is enabled, you must put SendBird.getEkey()
to the
request header with as the key. Otherwise, the server will
refuse the connection.
Generally, it is recommended to use getUrl()
to fetch resources, but if you want to
cache the file with URL string as a key while enabled the file encryption feature, it is
recommended to use this method instead. This is because the URL returned by this method does
not embed SendBird.getEkey()
, making it a less changing cache key.
SendBird.getEkey()
,
getUrl()
public java.lang.String getName()
public int getSize()
public java.lang.String getType()
public java.util.List<FileMessage.Thumbnail> getThumbnails()
BaseChannel.sendFileMessage(File, String, String, int, String, String, List, BaseChannel.SendFileMessageHandler)
.@Deprecated public FileMessage.RequestState getRequestState()
BaseMessage.getSendingStatus()
.FileMessage.RequestState
).public java.util.List<java.lang.String> getRequestedMentionUserIds()
SendingStatus#PENDING
or SendingStatus#FAILED
or SendingStatus#CANCELED
, empty list will be returned.public FileMessageParams getMessageParams()
SendingStatus#PENDING
or SendingStatus#FAILED
or SendingStatus#CANCELED
If else, it will return nullSendingStatus#SUCCEEDED
, return null.BaseMessageParams
,
UserMessageParams
,
FileMessageParams
,
UserMessage.getMessageParams()
,
getMessageParams()
public java.lang.String toString()
toString
in class BaseMessage
Copyright © 2021, Sendbird or its affiliates. All rights reserved.
Report a bug or request a feature
For further developer documentation, see Chat SDK Documentation. That documentation contains more detailed descriptions, conceptual overviews, definitions of terms, and code examples.