Message (Apache Ant API)
Keywords: org.apache.tools.ant.taskdefs.email.Message class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tools.ant.taskdefs.email
Class Message

    java.lang.Object
      org.apache.tools.ant.ProjectComponent
          org.apache.tools.ant.taskdefs.email.Message

public class Message
extends ProjectComponent

Class representing an email message.

Since:
  Ant 1.5
Author:
  roxspring@yahoo.com Rob Oxspring

Field Summary

Fields inherited from class org.apache.tools.ant.ProjectComponent
`project`

Constructor Summary
`Message()` Creates a new empty message
`Message(java.io.File file)` Creates a new message using the contents of the given file.
`Message(java.lang.String text)` Creates a new message based on the given string

Method Summary
`void` | `addText(java.lang.String text)` Adds a textual part of the message
`java.lang.String` | `getMimeType()` Returns the content type
`boolean` | `isMimeTypeSpecified()` Returns true if the mimeType has been set.
`void` | `print(java.io.PrintStream out)` Prints the message onto an output stream
`void` | `setMimeType(java.lang.String mimeType)` Sets the content type for the message
`void` | `setSrc(java.io.File src)` Sets the source file of the message

Methods inherited from class org.apache.tools.ant.ProjectComponent
`getProject, log, log, setProject`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Message

    public Message()

  Creates a new empty message

### Message

    public Message(java.lang.String text)

  Creates a new message based on the given string

Parameters:
  `text` - the message

### Message

    public 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

### addText

    public void addText(java.lang.String text)

  Adds a textual part of the message

  Parameters:
    `text` - some text to add

### setSrc

    public void setSrc(java.io.File src)

  Sets the source file of the message

  Parameters:
    `src` - the source of the message

### setMimeType

    public void setMimeType(java.lang.String mimeType)

  Sets the content type for the message

  Parameters:
    `mimeType` - a mime type e.g. "text/plain"

### getMimeType

    public java.lang.String getMimeType()

  Returns the content type

  Returns:
    the mime type

### print

    public void print(java.io.PrintStream out)
               throws java.io.IOException

  Prints the message onto an output stream

  Parameters:
    `out` - The print stream to write to
  Throws:
    `java.io.IOException` - if an error occurs

### isMimeTypeSpecified

    public boolean isMimeTypeSpecified()

  Returns true if the mimeType has been set.

  Returns:
    false if the default value is in use

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.