public interface Content
Core.createContent()
to create it, and then you should set at leastContent
can be multipart (contain other contents), have fileChatMessage
. Modifier and Type | Method and Description |
---|---|
void |
addContentTypeParameter(java.lang.String name,
java.lang.String value)
Adds a parameter to the ContentType header.
|
Content |
findPartByHeader(java.lang.String headerName,
java.lang.String headerValue)
Find a part from a multipart content looking for a part header with a specified
value. |
byte[] |
getBuffer()
Get the content data buffer, usually a string.
|
java.lang.String |
getCustomHeader(java.lang.String headerName)
Get a custom header value of a content.
|
java.lang.String |
getEncoding()
Get the encoding of the data buffer, for example "gzip".
|
java.lang.String |
getFilePath()
Get the file transfer filepath set for this content (replace
linphone_chat_message_get_file_transfer_filepath). |
int |
getFileSize()
Get the file size if content is either a FileContent or a FileTransferContent.
|
java.lang.String |
getKey()
Get the key associated with a RCS file transfer message if encrypted.
|
int |
getKeySize()
Get the size of key associated with a RCS file transfer message if encrypted.
|
java.lang.String |
getName()
Get the name associated with a RCS file transfer message.
|
long |
getNativePointer()
Gets the native pointer used by this class to make native method calls.
|
Content |
getPart(int index)
Get a part from a multipart content according to its index.
|
Content[] |
getParts()
Get all the parts from a multipart content.
|
java.lang.String |
getPlainFilePath()
If the content is an encrypted file, generate a temporary plain copy of the
file and returns its paths The caller is responsible to then delete this temporary copy and the returned string. |
int |
getSize()
Get the content data buffer size, excluding null character despite null
character is always set for convenience. |
java.lang.String |
getStringBuffer()
Deprecated.
2020-07-01. Use
getUtf8Text() instead. |
java.lang.String |
getSubtype()
Get the mime subtype of the content data.
|
java.lang.String |
getType()
Get the mime type of the content data.
|
java.lang.Object |
getUserData()
Gets the object stored in this object user's data
|
java.lang.String |
getUtf8Text()
Get the string content data buffer.
|
boolean |
isFile()
Tells whether or not this content contains a file.
|
boolean |
isFileEncrypted()
Tells whether or not this content contains an encrypted file.
|
boolean |
isFileTransfer()
Tells whether or not this content is a file transfer.
|
boolean |
isMultipart()
Tell whether a content is a multipart content.
|
boolean |
isText()
Tells whether or not this content contains text.
|
void |
setBuffer(byte[] buffer,
int size)
Set the content data buffer, usually a string.
|
void |
setEncoding(java.lang.String encoding)
Set the encoding of the data buffer, for example "gzip".
|
void |
setFilePath(java.lang.String filePath)
Set the file transfer filepath for this content (replace
linphone_chat_message_set_file_transfer_filepath). |
void |
setKey(java.lang.String key,
int keyLength)
Set the key associated with a RCS file transfer message if encrypted.
|
void |
setName(java.lang.String name)
Set the name associated with a RCS file transfer message.
|
void |
setSize(int size)
Set the content data size, excluding null character despite null character is
always set for convenience. |
void |
setStringBuffer(java.lang.String buffer)
Deprecated.
2020-07-01. Use
setUtf8Text(java.lang.String) instead. |
void |
setSubtype(java.lang.String subtype)
Set the mime subtype of the content data.
|
void |
setType(java.lang.String type)
Set the mime type of the content data.
|
void |
setUserData(java.lang.Object data)
Sets the object to store in this object user's data
|
void |
setUtf8Text(java.lang.String buffer)
Get the string content data buffer.
|
java.lang.String |
toString() |
@NonNull byte[] getBuffer()
@Nullable java.lang.String getEncoding()
void setEncoding(@Nullable java.lang.String encoding)
encoding
- The encoding of the data buffer. @Nullable java.lang.String getFilePath()
void setFilePath(@Nullable java.lang.String filePath)
filePath
- the file transfer filepath. int getFileSize()
boolean isFile()
boolean isFileEncrypted()
boolean isFileTransfer()
boolean isMultipart()
boolean isText()
@Nullable java.lang.String getKey()
int getKeySize()
@Nullable java.lang.String getName()
void setName(@Nullable java.lang.String name)
name
- The name of the content. @NonNull Content[] getParts()
java.lang.String getPlainFilePath()
int getSize()
void setSize(int size)
size
- The content data buffer size. @Deprecated @NonNull java.lang.String getStringBuffer()
getUtf8Text()
instead. @Deprecated void setStringBuffer(@NonNull java.lang.String buffer)
setUtf8Text(java.lang.String)
instead. buffer
- The string content data buffer in UTF8. @NonNull java.lang.String getSubtype()
void setSubtype(@NonNull java.lang.String subtype)
subtype
- The mime subtype of the content data, for example "html". @NonNull java.lang.String getType()
void setType(@NonNull java.lang.String type)
type
- The mime type of the content data, for example "application". @Nullable java.lang.String getUtf8Text()
void setUtf8Text(@Nullable java.lang.String buffer)
buffer
- The string content data buffer in UTF8. void addContentTypeParameter(@NonNull java.lang.String name, @Nullable java.lang.String value)
name
- the name of the parameter to add. value
- the value of the parameter to add. @Nullable Content findPartByHeader(@NonNull java.lang.String headerName, @NonNull java.lang.String headerValue)
headerName
- The name of the header to look for. headerValue
- The value of the header to look for. Content
object object the part if found, null otherwise. @Nullable java.lang.String getCustomHeader(@NonNull java.lang.String headerName)
headerName
- The name of the header to get the value from. @Nullable Content getPart(int index)
index
- The index of the part to get. Content
object holding the part if found, null otherwise. void setBuffer(@NonNull byte[] buffer, int size)
buffer
- The content data buffer. size
- The size of the content data buffer. void setKey(@NonNull java.lang.String key, int keyLength)
key
- The key to be used to encrypt/decrypt file associated to thiskeyLength
- The lengh of the key. void setUserData(java.lang.Object data)
data
- the object to storejava.lang.Object getUserData()
long getNativePointer()
java.lang.String toString()
toString
in class java.lang.Object