public class BodypartGeneralText extends Bodypart
When creating an instance of this class, you must provide the charset and the content. You must ensure that the content is correct for the charset.
The charset must be one the ones provided by the class Charset E.g. WEST_EUROPEAN (that maps to "1 6 100")
Modifier and Type | Class and Description |
---|---|
static class |
BodypartGeneralText.Charset
Available charsets to use for General Text bodyparts
|
Bodypart.Bodypart_Type
bodypart_size, bodypart_type
Constructor and Description |
---|
BodypartGeneralText(BodyPart bp_obj)
Constructor based on an existing bodypart object, for example, one read
from an existing message.
|
BodypartGeneralText(BodypartGeneralText.Charset cs,
java.lang.String ct)
Constructor based on data provided by the user, including the charset
and content.
|
BodypartGeneralText(boolean iso_8859_1,
java.lang.String ct)
Creates a General Text bodypart, with a content suitable for
ISO-8895-1 (if iso_8859_1 is true) or ISO-8895-2 (if iso_8859_1 is false).
|
BodypartGeneralText(java.lang.String charset,
java.lang.String ct)
Constructor based on data provided by the user, including the charset
and content.
|
BodypartGeneralText(java.lang.String charset,
java.lang.String rawContent,
boolean emptyCharset)
Constructor based on data provided by the user, including the charset
as a String and the raw content as a String.
|
Modifier and Type | Method and Description |
---|---|
BodypartGeneralText.Charset |
getCharset()
Deprecated.
callers should use
getCharsetString() ,
which returns all possible charset values in a String. |
java.lang.String |
getCharsetString()
Returns the charset string of this General Text bodypart
|
int |
getSize()
Returns the size, in bytes, of the message bodypart.
|
java.lang.String |
getStringRepresentation()
Returns the string representation of this message bodypart.
|
java.lang.String |
getTextContent()
Returns the content of this General Text bodypart
|
void |
saveBodypartRaw(java.lang.String filename)
Save the bodypart in the given filename
|
void |
saveBP(java.lang.String filename)
Save the bodypart in the given filename
|
void |
setCharset(BodypartGeneralText.Charset cs)
Sets the charset of this General Text bodypart
|
void |
setContentFromFile(java.lang.String file)
Sets the content of this General Text bodypart
|
void |
setSize(int s)
Sets the size of message bodypart in bytes.
|
void |
setTextContent(java.lang.String ct)
Sets the content of this General Text bodypart
|
getBodypartObject, getByteParam, getIntParam, getStringParam, getType, getTypeAsString, setByteParam, setIntParam, setStringParam
public BodypartGeneralText(BodyPart bp_obj) throws X400APIException
bp_obj
- X400APIException
public BodypartGeneralText(BodypartGeneralText.Charset cs, java.lang.String ct) throws X400APIException
cs
- ct
- X400APIException
public BodypartGeneralText(java.lang.String charset, java.lang.String ct) throws X400APIException
cs
- ct
- X400APIException
public BodypartGeneralText(java.lang.String charset, java.lang.String rawContent, boolean emptyCharset) throws X400APIException
charset
- rawContent
- emptyCharset
- X400APIException
public BodypartGeneralText(boolean iso_8859_1, java.lang.String ct) throws X400APIException
iso_8859_1
- ct
- X400APIException
public BodypartGeneralText.Charset getCharset() throws X400APIException
getCharsetString()
,
which returns all possible charset values in a String.X400APIException
public java.lang.String getCharsetString() throws X400APIException
X400APIException
public void setCharset(BodypartGeneralText.Charset cs) throws X400APIException
cs
- X400APIException
public java.lang.String getTextContent() throws X400APIException
X400APIException
public void setTextContent(java.lang.String ct) throws X400APIException
ct
- X400APIException
public void setContentFromFile(java.lang.String file) throws X400APIException
file
- X400APIException
public java.lang.String getStringRepresentation() throws X400APIException
X400APIException
public int getSize()
getSize
in class Bodypart
X400APIException
public void setSize(int s)
public void saveBP(java.lang.String filename) throws X400APIException
saveBP
in class Bodypart
filename
- X400APIException
public void saveBodypartRaw(java.lang.String filename) throws X400APIException, java.io.IOException
filename
- java.io.IOException
X400APIException
Version: 17.0v7-1
Copyright (c) 2009-2019 Isode