Class FileMessage
-
- All Implemented Interfaces:
public class FileMessage
File Message Class
The File Message class. This type of message will be stored and counted in the unread message count.
-
-
Constructor Summary
Constructors Constructor Description FileMessage(Array<byte> data)
FileMessage(Parcel in)
Constructor.
-
Method Summary
Modifier and Type Method Description static FileMessage
obtain(Uri url)
static FileMessage
obtain(Context context, Uri url)
Generates a FileMessage object. Array<byte>
encode()
Serializes the local message object into message data. void
writeToParcel(Parcel dest, int flags)
Writes the class's data into the provided Parcel. int
describeContents()
Describes the type of special objects included in the arrangement information of the Parcelable object. List<String>
getSearchableWord()
long
getSize()
Gets the file size in bytes. void
setSize(long size)
Sets the file size in bytes. String
getType()
Get the file extension, default is bin void
setType(String type)
Sets the file extension suffix. Uri
getFileUrl()
Retrieves the remote download URL of the file void
setFileUrl(Uri uri)
Sets the remote download URL for the file -
-
Constructor Detail
-
FileMessage
FileMessage(Array<byte> data)
-
FileMessage
FileMessage(Parcel in)
Constructor.- Parameters:
in
- The Parcel passed during initialization.
-
-
Method Detail
-
obtain
@Deprecated() static FileMessage obtain(Uri url)
- Parameters:
url
- The file URL.
-
obtain
static FileMessage obtain(Context context, Uri url)
Generates a FileMessage object. This method supports file and content protocol headers.
- Parameters:
context
- The context.url
- The file URL.
-
encode
Array<byte> encode()
Serializes the local message object into message data.
- Returns:
The message data.
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
Writes the class's data into the provided Parcel.
- Parameters:
dest
- The Parcel into which the object is written.flags
- Additional flags about how the object should be written, which can be 0 or PARCELABLE_WRITE_RETURN_VALUE.
-
describeContents
int describeContents()
Describes the type of special objects included in the arrangement information of the Parcelable object.
- Returns:
A flag indicating the arrangement of the special object type collection of the Parcelable object.
-
getSearchableWord
List<String> getSearchableWord()
-
getSize
long getSize()
Gets the file size in bytes.
- Returns:
The file size in bytes.
-
setSize
void setSize(long size)
Sets the file size in bytes.
- Parameters:
size
- The file size in bytes.
-
getType
String getType()
Get the file extension, default is bin
- Returns:
The file extension, default is bin
-
setType
void setType(String type)
Sets the file extension suffix. Default is bin.
- Parameters:
type
- The file extension suffix.
-
getFileUrl
Uri getFileUrl()
Retrieves the remote download URL of the file
- Returns:
The remote download URL of the file
-
setFileUrl
void setFileUrl(Uri uri)
Sets the remote download URL for the file
- Parameters:
uri
- The remote download URL for the file
-
-
-
-