public class Message extends ProjectComponent
Constructor and Description |
---|
Message()
Creates a new empty message
|
Message(File file)
Creates a new message using the contents of the given file.
|
Message(String text)
Creates a new message based on the given string
|
Modifier and Type | Method and Description |
---|---|
void |
addText(String text)
Adds a textual part of the message
|
String |
getCharset()
Returns the charset of mail message.
|
String |
getMimeType()
Returns the content type
|
boolean |
isMimeTypeSpecified()
Returns true if the mimeType has been set.
|
void |
print(PrintStream ps)
Prints the message onto an output stream
|
void |
setCharset(String charset)
Sets the character set of mail message.
|
void |
setInputEncoding(String encoding)
Sets the encoding to expect when reading the message from a file.
|
void |
setMimeType(String mimeType)
Sets the content type for the message
|
void |
setSrc(File src)
Sets the source file of the message
|
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
public Message()
public Message(File file)
file
- the source of the messagepublic Message(String text)
text
- the messagepublic void addText(String text)
text
- some text to addpublic String getCharset()
public String getMimeType()
public boolean isMimeTypeSpecified()
public void print(PrintStream ps) throws IOException
ps
- The print stream to write toIOException
- if an error occurspublic void setCharset(String charset)
charset
- the character set name.public void setInputEncoding(String encoding)
Will be ignored if the message has been specified inline.
encoding
- the name of the charset usedpublic void setMimeType(String mimeType)
mimeType
- a mime type e.g. "text/plain"public void setSrc(File src)
src
- the source of the message