Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.email

public Class Message

extends ProjectComponent
Class Inheritance
Imports
java.io.BufferedReader, .BufferedWriter, .File, .FileReader, .IOException, .InputStream, .InputStreamReader, .OutputStreamWriter, .PrintStream, .Reader, java.nio.file.Files, org.apache.tools.ant.ProjectComponent

Class representing an email message.
Since
Ant 1.5

Field Summary

Modifier and TypeField and Description
private StringBuffer
private String
private String
private File
private String
private boolean
Inherited from org.apache.tools.ant.ProjectComponent:
descriptionlocationproject

Constructor Summary

AccessConstructor and Description
public
Message()

Creates a new empty message

public
Message(String
the message
text
)

Creates a new message based on the given string

public
Message(File
the source of the message
file
)

Creates a new message using the contents of the given file.

Method Summary

Modifier and TypeMethod and Description
public void
addText(String
some text to add
text
)

Adds a textual part of the message

public String

Returns:

Charset of mail message.
getCharset
()

Returns the charset of mail message.

public String

Returns:

the mime type
getMimeType
()

Returns the content type

private Reader
public boolean

Returns:

false if the default value is in use
isMimeTypeSpecified
()

Returns true if the mimeType has been set.

public void
setCharset(String
the character set name.
charset
)

Sets the character set of mail message.

public void
setInputEncoding(String
the name of the charset used
encoding
)

Sets the encoding to expect when reading the message from a file.

public void
setMimeType(String
a mime type e.g. "text/plain"
mimeType
)

Sets the content type for the message

public void
setSrc(File
the source of the message
src
)

Sets the source file of the message

Inherited from org.apache.tools.ant.ProjectComponent:
clonegetDescriptiongetLocationgetProjectloglogsetDescriptionsetLocationsetProject

Field Detail

bufferback to summary
private StringBuffer buffer
charsetback to summary
private String charset
inputEncodingback to summary
private String inputEncoding
messageSourceback to summary
private File messageSource
mimeTypeback to summary
private String mimeType
specifiedback to summary
private boolean specified

Constructor Detail

Messageback to summary
public Message()

Creates a new empty message

Messageback to summary
public Message(String text)

Creates a new message based on the given string

Parameters
text:String

the message

Messageback to summary
public Message(File file)

Creates a new message using the contents of the given file.

Parameters
file:File

the source of the message

Method Detail

addTextback to summary
public void addText(String text)

Adds a textual part of the message

Parameters
text:String

some text to add

getCharsetback to summary
public String getCharset()

Returns the charset of mail message.

Returns:String

Charset of mail message.

Since
Ant 1.6
getMimeTypeback to summary
public String getMimeType()

Returns the content type

Returns:String

the mime type

getReaderback to summary
private Reader getReader(File f) throws IOException
isMimeTypeSpecifiedback to summary
public boolean isMimeTypeSpecified()

Returns true if the mimeType has been set.

Returns:boolean

false if the default value is in use

setCharsetback to summary
public void setCharset(String charset)

Sets the character set of mail message. Will be ignored if mimeType contains ....; Charset=... substring.

Parameters
charset:String

the character set name.

Since
Ant 1.6
setInputEncodingback to summary
public void setInputEncoding(String encoding)

Sets the encoding to expect when reading the message from a file.

Will be ignored if the message has been specified inline.

Parameters
encoding:String

the name of the charset used

Since
Ant 1.9.4
setMimeTypeback to summary
public void setMimeType(String mimeType)

Sets the content type for the message

Parameters
mimeType:String

a mime type e.g. "text/plain"

setSrcback to summary
public void setSrc(File src)

Sets the source file of the message

Parameters
src:File

the source of the message