Methods Summary |
---|
public void | addText(java.lang.String text)Adds a textual part of the message
buffer.append(text);
|
public java.lang.String | getCharset()Returns the charset of mail message.
return charset;
|
public java.lang.String | getMimeType()Returns the content type
return mimeType;
|
public boolean | isMimeTypeSpecified()Returns true if the mimeType has been set.
return specified;
|
public void | print(java.io.PrintStream ps)Prints the message onto an output stream
// We need character encoding aware printing here.
// So, using PrintWriter over OutputStreamWriter instead of PrintStream
PrintWriter out
= charset != null ? new PrintWriter(new OutputStreamWriter(ps, charset))
: new PrintWriter(ps);
if (messageSource != null) {
// Read message from a file
FileReader freader = new FileReader(messageSource);
try {
BufferedReader in = new BufferedReader(freader);
String line = null;
while ((line = in.readLine()) != null) {
out.println(getProject().replaceProperties(line));
}
} finally {
freader.close();
}
} else {
out.println(getProject().replaceProperties(buffer.substring(0)));
}
out.flush();
|
public void | setCharset(java.lang.String charset)Sets the character set of mail message.
Will be ignored if mimeType contains ....; Charset=... substring.
this.charset = charset;
|
public void | setMimeType(java.lang.String mimeType)Sets the content type for the message
this.mimeType = mimeType;
specified = true;
|
public void | setSrc(java.io.File src)Sets the source file of the message
this.messageSource = src;
|