Class Message
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.taskdefs.email.Message
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class Message extends ProjectComponent Class representing an email message.- Since:
- Ant 1.5
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Method SummaryModifier and Type Method Description voidaddText(java.lang.String text)Adds a textual part of the messagejava.lang.StringgetCharset()Returns the charset of mail message.java.lang.StringgetMimeType()Returns the content typebooleanisMimeTypeSpecified()Returns true if the mimeType has been set.voidprint(java.io.PrintStream ps)Prints the message onto an output streamvoidsetCharset(java.lang.String charset)Sets the character set of mail message.voidsetInputEncoding(java.lang.String encoding)Sets the encoding to expect when reading the message from a file.voidsetMimeType(java.lang.String mimeType)Sets the content type for the messagevoidsetSrc(java.io.File src)Sets the source file of the message- 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Constructor Detail- 
Messagepublic Message() Creates a new empty message
 - 
Messagepublic Message(java.lang.String text) Creates a new message based on the given string- Parameters:
- text- the message
 
 - 
Messagepublic Message(java.io.File file) Creates a new message using the contents of the given file.- Parameters:
- file- the source of the message
 
 
- 
 - 
Method Detail- 
addTextpublic void addText(java.lang.String text) Adds a textual part of the message- Parameters:
- text- some text to add
 
 - 
setSrcpublic void setSrc(java.io.File src) Sets the source file of the message- Parameters:
- src- the source of the message
 
 - 
setMimeTypepublic void setMimeType(java.lang.String mimeType) Sets the content type for the message- Parameters:
- mimeType- a mime type e.g. "text/plain"
 
 - 
getMimeTypepublic java.lang.String getMimeType() Returns the content type- Returns:
- the mime type
 
 - 
printpublic void print(java.io.PrintStream ps) throws java.io.IOExceptionPrints the message onto an output stream- Parameters:
- ps- The print stream to write to
- Throws:
- java.io.IOException- if an error occurs
 
 - 
isMimeTypeSpecifiedpublic boolean isMimeTypeSpecified() Returns true if the mimeType has been set.- Returns:
- false if the default value is in use
 
 - 
setCharsetpublic void setCharset(java.lang.String charset) Sets the character set of mail message. Will be ignored if mimeType contains ....; Charset=... substring.- Parameters:
- charset- the character set name.
- Since:
- Ant 1.6
 
 - 
getCharsetpublic java.lang.String getCharset() Returns the charset of mail message.- Returns:
- Charset of mail message.
- Since:
- Ant 1.6
 
 - 
setInputEncodingpublic void setInputEncoding(java.lang.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- the name of the charset used
- Since:
- Ant 1.9.4
 
 
- 
 
-