dlr 02/01/18 11:29:23
Modified: src/util/java/org/apache/fulcrum/template TemplateEmail.java
Log:
o Used List interface.
o Removed extra white space and fixed JavaDoc formatting.
o Improved error reporting.
Revision Changes Path
1.6 +10 -12
jakarta-turbine-fulcrum/src/util/java/org/apache/fulcrum/template/TemplateEmail.java
Index: TemplateEmail.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-fulcrum/src/util/java/org/apache/fulcrum/template/TemplateEmail.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -u -r1.5 -r1.6
--- TemplateEmail.java 18 Jan 2002 19:22:37 -0000 1.5
+++ TemplateEmail.java 18 Jan 2002 19:29:23 -0000 1.6
@@ -55,6 +55,7 @@
*/
import java.util.ArrayList;
+import java.util.List;
import javax.mail.internet.InternetAddress;
import org.apache.commons.mail.SimpleEmail;
import org.apache.commons.util.StringUtils;
@@ -126,7 +127,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jon S. Stevens</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Greg Coladonato</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Elicia David</a>
- * @version $Id: TemplateEmail.java,v 1.5 2002/01/18 19:22:37 dlr Exp $
+ * @version $Id: TemplateEmail.java,v 1.6 2002/01/18 19:29:23 dlr Exp $
*/
public class TemplateEmail
{
@@ -152,10 +153,10 @@
private String subject = null;
/** The to email list. */
- private ArrayList toList = null;
+ private List toList = null;
/** The cc list. */
- private ArrayList ccList = null;
+ private List ccList = null;
/** The column to word-wrap at. <code>0</code> indicates no wrap. */
private int wordWrap = 0;
@@ -176,6 +177,7 @@
*/
public TemplateEmail()
{
+ this(null);
}
/**
@@ -186,7 +188,6 @@
this.context = context;
}
-
/** Add a recipient TO to the email.
*
* @param email A String.
@@ -211,12 +212,11 @@
}
catch (Exception e)
{
- throw new Exception("cannot add to");
+ throw new Exception("Cannot add 'To' recipient: " + e);
}
}
-
- /**
+ /**
* Add a recipient CC to the email.
*
* @param email A String.
@@ -241,12 +241,10 @@
}
catch (Exception e)
{
- throw new Exception("cannot add cc");
+ throw new Exception("Cannot add 'CC' recipient: " + e);
}
}
-
-
/**
* To: name, email
*
@@ -312,8 +310,8 @@
}
/**
- * TemplateService template to execute. Path is relative to the TemplateService
- * templates directory.
+ * TemplateService template to execute. Path is relative to the
+ * TemplateService templates directory.
*
* @param template A String with the template.
* @return A TemplateEmail (self).
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>