commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ep...@apache.org
Subject cvs commit: jakarta-commons-sandbox/email/src/java/org/apache/commons/mail package.html Email.java MailMessage.java HtmlEmail.java EmailAttachment.java
Date Fri, 29 Oct 2004 12:05:13 GMT
epugh       2004/10/29 05:05:13

  Modified:    email/src/java/org/apache/commons/mail Email.java
                        MailMessage.java HtmlEmail.java
                        EmailAttachment.java
  Added:       email/src/java/org/apache/commons/mail package.html
  Log:
  Checkstyle fixes
  
  Revision  Changes    Path
  1.24      +12 -12    jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java
  
  Index: Email.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/Email.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Email.java	28 Oct 2004 19:28:03 -0000	1.23
  +++ Email.java	29 Oct 2004 12:05:13 -0000	1.24
  @@ -103,46 +103,46 @@
       public static final String US_ASCII = "us-ascii";
   
       /** The email message to send. */
  -    protected MimeMessage message = null;
  +    protected MimeMessage message;
   
       /** The charset to use for this message */
  -    protected String charset = null;
  +    protected String charset;
   
       /** The Address of the sending party, mandatory */
  -    protected InternetAddress fromAddress = null;
  +    protected InternetAddress fromAddress;
   
       /** The Subject  */
  -    protected String subject = null;
  +    protected String subject;
   
       /** An attachment  */
  -    protected MimeMultipart emailBody = null;
  +    protected MimeMultipart emailBody;
   
       /** The content  */
  -    protected Object content = null;
  +    protected Object content;
   
       /** The content type  */
  -    protected String contentType = null;
  +    protected String contentType;
   
       /** Set session debugging on or off */
       protected boolean debug = false;
   
       /** Sent date */
  -    protected Date sentDate = null;
  +    protected Date sentDate;
   
       /** The Session to mail with */
  -    private Session session = null;
  +    private Session session;
   
       /**
        * Instance of an <code>Authenticator</code> object that will be used
        * when authentication is requested from the mail server.
        */
  -    protected Authenticator authenticator = null;
  +    protected Authenticator authenticator;
   
       /**
        * The hostname of the mail server with which to connect. If null will try
        * to get property from system.properties. If still null, quit
        */
  -    protected String hostName = null;
  +    protected String hostName;
   
       /**
        * The port number of the mail server to connect to.  
  
  
  
  1.8       +18 -14    jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/MailMessage.java
  
  Index: MailMessage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/MailMessage.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MailMessage.java	25 Oct 2004 16:32:28 -0000	1.7
  +++ MailMessage.java	29 Oct 2004 12:05:13 -0000	1.8
  @@ -16,11 +16,15 @@
   package org.apache.commons.mail;
   
   import java.io.UnsupportedEncodingException;
  -import java.util.Enumeration;
  +import java.util.ArrayList;
  +import java.util.HashMap;
   import java.util.Hashtable;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   import java.util.Properties;
   import java.util.StringTokenizer;
  -import java.util.Vector;
  +
   import javax.mail.Message;
   import javax.mail.MessagingException;
   import javax.mail.Session;
  @@ -77,7 +81,7 @@
        * or  2(high) 3(normal) 4(low) and 5(lowest)
        * Disposition-Notification-To: returnR user@domain.net
        */
  -    protected Hashtable headers;
  +    protected Map headers;
   
       /**
        * The email address that the mail is being sent from.
  @@ -192,7 +196,7 @@
       {
           if (headers == null)
           {
  -            headers = new Hashtable();
  +            headers = new HashMap();
           }
           headers.put(name, value);
       }
  @@ -208,16 +212,16 @@
           String[] addressList;
           if (str.indexOf(",") != -1)
           {
  -            Vector v = new Vector();
  +            List v = new ArrayList();
               StringTokenizer st = new StringTokenizer(str, ",", false);
               while (st.hasMoreTokens())
               {
  -                v.addElement(st.nextToken());
  +                v.add(st.nextToken());
               }
               addressList = new String[v.size()];
               for (int i = 0; i < v.size(); i++)
               {
  -                addressList[i] = (String) v.elementAt(i);
  +                addressList[i] = (String) v.get(i);
               }
           }
           else
  @@ -276,16 +280,16 @@
           String[] headerList;
           if (str.indexOf(",") != -1)
           {
  -            Vector v = new Vector();
  +            List v = new ArrayList();
               StringTokenizer st = new StringTokenizer(str, ",", false);
               while (st.hasMoreTokens())
               {
  -                v.addElement(st.nextToken());
  +                v.add(st.nextToken());
               }
               headerList = new String[v.size()];
               for (int i = 0; i < v.size(); i++)
               {
  -                headerList[i] = (String) v.elementAt(i);
  +                headerList[i] = (String) v.get(i);
               }
           }
           else
  @@ -432,10 +436,10 @@
   
               if (headers != null)
               {
  -                Enumeration e = headers.keys();
  -                while (e.hasMoreElements())
  +                Iterator i = headers.keySet().iterator();
  +                while (i.hasNext())
                   {
  -                    String name = (String) e.nextElement();
  +                    String name = (String) i.next();
                       String value = (String) headers.get(name);
                       msg.addHeader(name, value);
                   }
  
  
  
  1.13      +3 -3      jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/HtmlEmail.java
  
  Index: HtmlEmail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/HtmlEmail.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HtmlEmail.java	28 Oct 2004 18:48:39 -0000	1.12
  +++ HtmlEmail.java	29 Oct 2004 12:05:13 -0000	1.13
  @@ -71,7 +71,7 @@
   
       /** Defintion of the length of generated CID's */
       public static final int CID_LENGTH = 10;
  -    
  +
       /**
        * Set the text content.
        *
  @@ -165,7 +165,7 @@
           mbp.setFileName(name);
           mbp.setDisposition("inline");
           String cid = RandomStringUtils.randomAlphabetic(HtmlEmail.CID_LENGTH).toLowerCase();
  -        mbp.addHeader("Content-ID","<"+ cid +">");
  +        mbp.addHeader("Content-ID", "<" + cid + ">");
   
           this.inlineImages.add(mbp);
           return cid;
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/EmailAttachment.java
  
  Index: EmailAttachment.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/EmailAttachment.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- EmailAttachment.java	25 Oct 2004 16:32:28 -0000	1.6
  +++ EmailAttachment.java	29 Oct 2004 12:05:13 -0000	1.7
  @@ -40,7 +40,7 @@
       private String path = "";
   
       /** The HttpURI where the file can be got. */
  -    private URL url = null;
  +    private URL url;
   
       /** The disposition. */
       private String disposition = EmailAttachment.ATTACHMENT;
  
  
  
  1.1                  jakarta-commons-sandbox/email/src/java/org/apache/commons/mail/package.html
  
  Index: package.html
  ===================================================================
  <html>
  <head>
  </head>
  
  <body>
  Email package.
  <p>
  <br>
  <font size="-2">$Id: package.html,v 1.1 2004/10/29 12:05:13 epugh Exp $</font>
  </body>
  </html>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message