ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email EmailAddress.java EmailTask.java Mailer.java Message.java MimeMailer.java PlainMailer.java UUMailer.java
Date Fri, 12 Apr 2002 07:27:45 GMT
bodewig     02/04/12 00:27:45

  Modified:    src/main/org/apache/tools/ant/taskdefs LoadFile.java
                        LoadProperties.java SendEmail.java
               src/main/org/apache/tools/ant/taskdefs/email
                        EmailAddress.java EmailTask.java Mailer.java
                        Message.java MimeMailer.java PlainMailer.java
                        UUMailer.java
  Log:
  bug 7552 audit of <mail> - reset internal state.
  
  Cosmetics.
  
  Revision  Changes    Path
  1.14      +4 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadFile.java
  
  Index: LoadFile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadFile.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- LoadFile.java	10 Apr 2002 00:19:54 -0000	1.13
  +++ LoadFile.java	12 Apr 2002 07:27:45 -0000	1.14
  @@ -72,6 +72,7 @@
    *
    * @author Steve Loughran
    * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
  + * @since Ant 1.5
    * @ant.task category="utility"
    */
   public final class LoadFile extends Task {
  @@ -103,7 +104,7 @@
       private final Vector filterChains = new Vector();
   
       /**
  -     * Encoding to use for filenames, defaults to the platform's default
  +     * Encoding to use for input, defaults to the platform's default
        * encoding. <p>
        *
        * For a list of possible values see <a href="http://java.sun.com/products/jdk/1.2/docs/guide/internat/encoding.doc.html">
  @@ -192,7 +193,8 @@
   
               if (text != null) {
                   project.setNewProperty(property, text);
  -                log("loaded " + text.length() + " characters",Project.MSG_VERBOSE);
  +                log("loaded " + text.length() + " characters",
  +                    Project.MSG_VERBOSE);
                   log(property+" := "+text,Project.MSG_DEBUG);
               }
   
  
  
  
  1.4       +1 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java
  
  Index: LoadProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/LoadProperties.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LoadProperties.java	10 Apr 2002 00:19:54 -0000	1.3
  +++ LoadProperties.java	12 Apr 2002 07:27:45 -0000	1.4
  @@ -73,6 +73,7 @@
    * Load a file's contents as Ant Properties.
    *
    * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
  + * @since Ant 1.5
    * @ant.task category="utility"
    */
   public final class LoadProperties extends Task {
  
  
  
  1.13      +2 -0      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SendEmail.java
  
  Index: SendEmail.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/SendEmail.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SendEmail.java	3 Mar 2002 01:46:20 -0000	1.12
  +++ SendEmail.java	12 Apr 2002 07:27:45 -0000	1.13
  @@ -106,6 +106,8 @@
    * @author glenn_twiggs@bmc.com
    * @author <a href="mailto:umagesh@rediffmail.com">Magesh Umasankar</a>
    *
  + * @since Ant 1.2
  + *
    * @ant.task name="mail" category="network"
    */
   public class SendEmail extends EmailTask
  
  
  
  1.2       +14 -8     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/EmailAddress.java
  
  Index: EmailAddress.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/EmailAddress.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EmailAddress.java	5 Feb 2002 09:32:48 -0000	1.1
  +++ EmailAddress.java	12 Apr 2002 07:27:45 -0000	1.2
  @@ -57,7 +57,7 @@
    * Holds an email address.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   public class EmailAddress
   {
  @@ -70,7 +70,8 @@
       {
       }
   
  -    /** Creates a new email address based on the given string
  +    /** 
  +     * Creates a new email address based on the given string
        * @param address the email address
        */
       public EmailAddress( String address )
  @@ -78,7 +79,8 @@
           this.address = address;
       }
   
  -    /** sets the personal / display name of the address
  +    /** 
  +     * Sets the personal / display name of the address
        * @param name the display name
        */
       public void setName( String name )
  @@ -86,7 +88,8 @@
           this.name = name;
       }
   
  -    /** sets the email address
  +    /** 
  +     * Sets the email address
        * @param address the actual email address
        */
       public void setAddress( String address )
  @@ -94,7 +97,8 @@
           this.address = address;
       }
   
  -    /** Constructs a string "name &lt;address&gt;" or "address"
  +    /** 
  +     * Constructs a string "name &lt;address&gt;" or "address"
        * @return a string representation of the address
        */
       public String toString()
  @@ -109,7 +113,8 @@
           }
       }
   
  -    /** returns the address
  +    /** 
  +     * Returns the address
        * @return the address part
        */
       public String getAddress()
  @@ -117,11 +122,12 @@
           return address;
       }
   
  -    /** returns the display name
  +    /** 
  +     * Returns the display name
        * @return the display name part
        */
       public String getName()
       {
           return name;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.10      +81 -42    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java
  
  Index: EmailTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/EmailTask.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EmailTask.java	3 Mar 2002 01:46:23 -0000	1.9
  +++ EmailTask.java	12 Apr 2002 07:27:45 -0000	1.10
  @@ -67,8 +67,8 @@
   import org.apache.tools.ant.types.FileSet;
   
   /**
  - * A task to send SMTP email. This is a refactoring of the SendMail and MimeMail
  - * tasks such that both are within a single task.
  + * A task to send SMTP email. This is a refactoring of the SendMail
  + * and MimeMail tasks such that both are within a single task.
    *
    * @author <a href="mailto:umagesh@apache.org">Magesh Umasankar</a>
    * @author glenn_twiggs@bmc.com
  @@ -76,7 +76,7 @@
    * @author ehatcher@apache.org Erik Hatcher
    * @author paulo.gaspar@krankikom.de Paulo Gaspar
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    *
    * @ant.task name="mail" category="network"
    */
  @@ -152,7 +152,8 @@
       private Vector files = new Vector();
       private Vector filesets = new Vector();
   
  -    /** Allows the build writer to choose the preferred encoding method
  +    /** 
  +     * Allows the build writer to choose the preferred encoding method
        * @param encoding The encoding (one of AUTO,MIME,UU,PLAIN)
        */
       public void setEncoding( Encoding encoding )
  @@ -160,7 +161,8 @@
           this.encoding = encoding.getValue();
       }
   
  -    /** Sets the mail server port
  +    /** 
  +     * Sets the mail server port
        * @param port The port to use
        */
       public void setMailport( int port )
  @@ -168,7 +170,8 @@
           this.port = port;
       }
   
  -    /** Sets the host
  +    /** 
  +     * Sets the host
        * @param host The host to connect to
        */
       public void setMailhost( String host )
  @@ -176,7 +179,8 @@
           this.host = host;
       }
   
  -    /** Sets the subject line of the email
  +    /** 
  +     * Sets the subject line of the email
        *
        * @param subject Subject of this email.
        */
  @@ -185,34 +189,39 @@
           this.subject = subject;
       }
   
  -    /** Shorthand method to set the message
  +    /** 
  +     * Shorthand method to set the message
        * @param message Message body of this email.
        */
       public void setMessage( String message )
       {
           if( this.message != null )
           {
  -            throw new BuildException( "Only one message can be sent in an email" );
  +            throw new BuildException( "Only one message can be sent in an "
  +                                      + "email" );
           }
   
           this.message = new Message( message );
       }
   
  -    /** Shorthand method to set the message from a file
  +    /** 
  +     * Shorthand method to set the message from a file
        * @param file The file from which to take the message
        */
       public void setMessageFile( File file )
       {
           if( this.message != null )
           {
  -            throw new BuildException( "Only one message can be sent in an email" );
  +            throw new BuildException( "Only one message can be sent in an "
  +                                      + "email" );
           }
   
           this.message = new Message( file );
       }
   
  -    /** Shorthand method to set type of the text message, text/plain by default but text/html
  -     * or text/xml is quite feasible.
  +    /** 
  +     * Shorthand method to set type of the text message, text/plain by
  +     * default but text/html or text/xml is quite feasible.
        *
        * @param type The new MessageMimeType value
        */
  @@ -221,7 +230,8 @@
           this.messageMimeType = type;
       }
   
  -    /** Add a message elemnt
  +    /** 
  +     * Add a message elemnt
        * @param message The message object
        * @throws BuildException if a message has already been added
        */
  @@ -230,13 +240,15 @@
       {
           if( this.message != null )
           {
  -            throw new BuildException( "Only one message can be sent in an email" );
  +            throw new BuildException( "Only one message can be sent in an "
  +                                      + "email" );
           }
   
           this.message = message;
       }
   
  -    /** Adds a from address element
  +    /** 
  +     * Adds a from address element
        * @param address The address to send from
        */
       public void addFrom( EmailAddress address )
  @@ -249,7 +261,8 @@
           this.from = address;
       }
   
  -    /** Shorthand to set the from address element
  +    /** 
  +     * Shorthand to set the from address element
        *
        * @param address The address to send mail from
        */
  @@ -263,7 +276,8 @@
           this.from = new EmailAddress( address );
       }
   
  -    /** Adds a to address element
  +    /** 
  +     * Adds a to address element
        * @param address An email address
        */
       public void addTo( EmailAddress address )
  @@ -271,8 +285,8 @@
           toList.addElement( address );
       }
   
  -    /** Adds "to" address elements
  -     *
  +    /** 
  +     * Adds "to" address elements
        *
        * @param list Comma separated list of addresses
        */
  @@ -286,7 +300,8 @@
           }
       }
   
  -    /** Adds "cc" address element
  +    /** 
  +     * Adds "cc" address element
        * @param address The email address
        */
       public void addCc( EmailAddress address )
  @@ -294,8 +309,8 @@
           ccList.addElement( address );
       }
   
  -    /** Adds "cc" address elements
  -     *
  +    /** 
  +     * Adds "cc" address elements
        *
        * @param list Comma separated list of addresses
        */
  @@ -309,7 +324,8 @@
           }
       }
   
  -    /** Adds "bcc" address elements
  +    /** 
  +     * Adds "bcc" address elements
        * @param address The email address
        */
       public void addBcc( EmailAddress address )
  @@ -317,8 +333,8 @@
           bccList.addElement( address );
       }
   
  -    /** Adds "bcc" address elements
  -     *
  +    /** 
  +     * Adds "bcc" address elements
        *
        * @param list comma separated list of addresses
        */
  @@ -332,7 +348,8 @@
           }
       }
   
  -    /** Indicates whether BuildExceptions should be passed back to the core
  +    /** 
  +     * Indicates whether BuildExceptions should be passed back to the core
        *
        * @param failOnError The new FailOnError value
        */
  @@ -341,7 +358,8 @@
           this.failOnError = failOnError;
       }
   
  -    /** Adds a list of files to be attached
  +    /** 
  +     * Adds a list of files to be attached
        *
        * @param filenames Comma separated list of files
        */
  @@ -355,7 +373,8 @@
           }
       }
   
  -    /** Adds a set of files (nested fileset attribute).
  +    /** 
  +     * Adds a set of files (nested fileset attribute).
        * @param fs The fileset
        */
       public void addFileset( FileSet fs )
  @@ -363,16 +382,19 @@
           filesets.addElement( fs );
       }
   
  -    /** Sets Includefilenames attribute
  +    /** 
  +     * Sets Includefilenames attribute
        *
  -     * @param includeFileNames Whether to include filenames in the text of the message
  +     * @param includeFileNames Whether to include filenames in the
  +     * text of the message
        */
       public void setIncludefilenames( boolean includeFileNames )
       {
           this.includeFileNames = includeFileNames;
       }
   
  -    /** Identifies whether file names should be included
  +    /** 
  +     * Identifies whether file names should be included
        * @return Identifies whether file names should be included
        */
       public boolean getIncludeFileNames()
  @@ -380,10 +402,13 @@
           return includeFileNames;
       }
   
  -    /** Sends an email
  +    /** 
  +     * Sends an email
        */
       public void execute()
       {
  +        Message savedMessage = message;
  +        Vector savedFiles = (Vector) files.clone();
           try
           {
               Mailer mailer = null;
  @@ -392,11 +417,14 @@
               boolean autoFound = false;
   
               // try MIME format
  -            if( encoding.equals( MIME ) || ( encoding.equals( AUTO ) && !autoFound
) )
  +            if( encoding.equals( MIME ) 
  +                || ( encoding.equals( AUTO ) && !autoFound ) )
               {
                   try
                   {
  -                    mailer = (Mailer)Class.forName( "org.apache.tools.ant.taskdefs.email.MimeMailer"
).newInstance();
  +                    mailer = 
  +                        (Mailer) Class.forName( "org.apache.tools.ant.taskdefs.email.MimeMailer"
)
  +                        .newInstance();
                       autoFound = true;
                       log( "Using MIME mail", Project.MSG_VERBOSE );
                   }
  @@ -407,11 +435,14 @@
               }
   
               // try UU format
  -            if( encoding.equals( UU ) || ( encoding.equals( AUTO ) && !autoFound
) )
  +            if( encoding.equals( UU ) 
  +                || ( encoding.equals( AUTO ) && !autoFound ) )
               {
                   try
                   {
  -                    mailer = (Mailer)Class.forName( "org.apache.tools.ant.taskdefs.email.UUMailer"
).newInstance();
  +                    mailer = 
  +                        (Mailer)Class.forName( "org.apache.tools.ant.taskdefs.email.UUMailer"
)
  +                        .newInstance();
                       autoFound = true;
                       log( "Using UU mail", Project.MSG_VERBOSE );
                   }
  @@ -422,7 +453,8 @@
               }
   
               // try plain format
  -            if( encoding.equals( PLAIN ) || ( encoding.equals( AUTO ) && !autoFound
) )
  +            if( encoding.equals( PLAIN ) 
  +                || ( encoding.equals( AUTO ) && !autoFound ) )
               {
                   mailer = new PlainMailer();
                   autoFound = true;
  @@ -432,7 +464,8 @@
               // a valid mailer must be present by now
               if( mailer == null )
               {
  -                throw new BuildException( "Failed to initialise encoding: " + encoding
);
  +                throw new BuildException( "Failed to initialise encoding: " 
  +                                          + encoding );
               }
   
               // a valid message is required
  @@ -450,7 +483,8 @@
               // at least one address to send to/cc/bcc is required
               if( toList.isEmpty() && ccList.isEmpty() && bccList.isEmpty()
)
               {
  -                throw new BuildException( "At least one of to,cc or bcc must be supplied"
);
  +                throw new BuildException( "At least one of to,cc or bcc must "
  +                                          + "be supplied" );
               }
   
               // set the mimetype if not done already (and required)
  @@ -458,7 +492,8 @@
               {
                   if( message.isMimeTypeSpecified() )
                   {
  -                    throw new BuildException( "The mime type can only be specified in one
location" );
  +                    throw new BuildException( "The mime type can only be "
  +                                              + "specified in one location" );
                   }
                   else
                   {
  @@ -508,7 +543,8 @@
   
               // let the user know what happened
               int count = files.size();
  -            log( "Sent email with " + count + " attachment" + ( count == 1?"":"s" ), Project.MSG_INFO
);
  +            log( "Sent email with " + count + " attachment" 
  +                 + ( count == 1?"":"s" ), Project.MSG_INFO );
           }
           catch( BuildException e )
           {
  @@ -517,6 +553,9 @@
               {
                   throw e;
               }
  +        } finally {
  +            message = savedMessage;
  +            files = savedFiles;
           }
       }
   }
  
  
  
  1.3       +26 -14    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Mailer.java
  
  Index: Mailer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Mailer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Mailer.java	6 Feb 2002 00:24:44 -0000	1.2
  +++ Mailer.java	12 Apr 2002 07:27:45 -0000	1.3
  @@ -61,7 +61,7 @@
    * Base class for the various emailing implementations.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   abstract class Mailer
   {
  @@ -77,7 +77,8 @@
       protected Task task;
       protected boolean includeFileNames = false;
   
  -    /** sets the mail server
  +    /** 
  +     * Sets the mail server
        * @param host
        */
       public void setHost( String host )
  @@ -85,7 +86,8 @@
           this.host = host;
       }
   
  -    /** sets the smtp port
  +    /** 
  +     * Sets the smtp port
        * @param port
        */
       public void setPort( int port )
  @@ -93,7 +95,8 @@
           this.port = port;
       }
   
  -    /** sets the message
  +    /** 
  +     * Sets the message
        * @param m
        */
       public void setMessage( Message m )
  @@ -101,7 +104,8 @@
           this.message = m;
       }
   
  -    /** sets the address to send from
  +    /** 
  +     * Sets the address to send from
        * @param from
        */
       public void setFrom( EmailAddress from )
  @@ -109,7 +113,8 @@
           this.from = from;
       }
   
  -    /** set the to addresses
  +    /** 
  +     * Set the to addresses
        * @param list
        */
       public void setToList( Vector list )
  @@ -117,7 +122,8 @@
           this.toList = list;
       }
   
  -    /** sets the cc addresses
  +    /** 
  +     * Sets the cc addresses
        * @param list
        */
       public void setCcList( Vector list )
  @@ -125,7 +131,8 @@
           this.ccList = list;
       }
   
  -    /** sets the bcc addresses
  +    /** 
  +     * Sets the bcc addresses
        * @param list
        */
       public void setBccList( Vector list )
  @@ -133,7 +140,8 @@
           this.bccList = list;
       }
   
  -    /** sets the files to attach
  +    /** 
  +     * Sets the files to attach
        * @param files
        */
       public void setFiles( Vector files )
  @@ -141,7 +149,8 @@
           this.files = files;
       }
   
  -    /** sets the subject
  +    /** 
  +     * Sets the subject
        * @param subject
        */
       public void setSubject( String subject )
  @@ -149,7 +158,8 @@
           this.subject = subject;
       }
   
  -    /** sets the owning task
  +    /** 
  +     * Sets the owning task
        * @param task
        */
       public void setTask( Task task )
  @@ -157,7 +167,8 @@
           this.task = task;
       }
   
  -    /** indicates whether filenames should be listed in the body
  +    /** 
  +     * Indicates whether filenames should be listed in the body
        * @param b
        */
       public void setIncludeFileNames( boolean b )
  @@ -165,9 +176,10 @@
           this.includeFileNames = b;
       }
   
  -    /** This method should send the email
  +    /** 
  +     * This method should send the email
        * @throws BuildException
        */
       public abstract void send()
           throws BuildException;
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +20 -11    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Message.java
  
  Index: Message.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/Message.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Message.java	5 Feb 2002 09:32:48 -0000	1.1
  +++ Message.java	12 Apr 2002 07:27:45 -0000	1.2
  @@ -63,7 +63,7 @@
    * Class representing an email message.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   public class Message
   {
  @@ -72,13 +72,15 @@
       private String mimeType = "text/plain";
       private boolean specified = false;
   
  -    /** creates a new empty message
  +    /** 
  +     * Creates a new empty message
        */
       public Message()
       {
       }
   
  -    /** Creates a new message based on the given string
  +    /** 
  +     * Creates a new message based on the given string
        * @param text the message
        */
       public Message( String text )
  @@ -86,7 +88,8 @@
           addText( text );
       }
   
  -    /** Creates a new message using the contents of the given file.
  +    /** 
  +     * Creates a new message using the contents of the given file.
        * @param file the source of the message
        */
       public Message( File file )
  @@ -94,7 +97,8 @@
           messageSource = file;
       }
   
  -    /** Adds a textual part of the message
  +    /** 
  +     * Adds a textual part of the message
        * @param text some text to add
        */
       public void addText( String text )
  @@ -102,7 +106,8 @@
           buffer.append( text );
       }
   
  -    /** Sets the source file of the message
  +    /** 
  +     * Sets the source file of the message
        * @param src the source of the message
        */
       public void setSrc( File src )
  @@ -110,7 +115,8 @@
           this.messageSource = src;
       }
   
  -    /** Sets the content type for the message
  +    /** 
  +     * Sets the content type for the message
        * @param mimeType a mime type e.g. "text/plain"
        */
       public void setMimeType( String mimeType )
  @@ -119,7 +125,8 @@
           specified = true;
       }
   
  -    /** Returns the content type
  +    /** 
  +     * Returns the content type
        * @return the mime type
        */
       public String getMimeType()
  @@ -127,7 +134,8 @@
           return mimeType;
       }
   
  -    /** prints the message onto an output stream
  +    /** 
  +     * Prints the message onto an output stream
        * @param out The print stream to write to
        * @throws IOException if an error occurs
        */
  @@ -158,11 +166,12 @@
           }
       }
   
  -    /** returns true iff the mimeType has been set.
  +    /** 
  +     * Returns true iff the mimeType has been set.
        * @return false if the default value is in use
        */
       public boolean isMimeTypeSpecified()
       {
           return specified;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.4       +17 -10    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java
  
  Index: MimeMailer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/MimeMailer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MimeMailer.java	7 Feb 2002 20:32:34 -0000	1.3
  +++ MimeMailer.java	12 Apr 2002 07:27:45 -0000	1.4
  @@ -78,7 +78,7 @@
    * Uses the JavaMail classes to send Mime format email.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   class MimeMailer
       extends Mailer
  @@ -93,8 +93,9 @@
               props.put( "mail.smtp.host", host );
               props.put( "mail.smtp.port", String.valueOf( port ) );
   
  -            //Aside, the JDK is clearly unaware of the scottish 'session', which
  -            //involves excessive quantities of alcohol :-)
  +            // Aside, the JDK is clearly unaware of the scottish
  +            // 'session', which //involves excessive quantities of
  +            // alcohol :-)
               Session sesh = Session.getDefaultInstance( props, null );
   
               //create the message
  @@ -108,12 +109,16 @@
               }
               else
               {
  -                msg.setFrom( new InternetAddress( from.getAddress(), from.getName() ) );
  +                msg.setFrom( new InternetAddress( from.getAddress(), 
  +                                                  from.getName() ) );
               }
   
  -            msg.setRecipients( Message.RecipientType.TO, internetAddresses( toList ) );
  -            msg.setRecipients( Message.RecipientType.CC, internetAddresses( ccList ) );
  -            msg.setRecipients( Message.RecipientType.BCC, internetAddresses( bccList )
);
  +            msg.setRecipients( Message.RecipientType.TO, 
  +                               internetAddresses( toList ) );
  +            msg.setRecipients( Message.RecipientType.CC, 
  +                               internetAddresses( ccList ) );
  +            msg.setRecipients( Message.RecipientType.BCC, 
  +                               internetAddresses( bccList ) );
   
               if( subject != null )
               {
  @@ -139,7 +144,8 @@
                   if( !file.exists() || !file.canRead() )
                   {
                       throw new BuildException( "File \"" + file.getAbsolutePath()
  -                                              + "\" does not exist or is not readable."
);
  +                                              + "\" does not exist or is not "
  +                                              + "readable." );
                   }
                   FileDataSource fileData = new FileDataSource( file );
                   DataHandler fileDataHandler = new DataHandler( fileData );
  @@ -175,10 +181,11 @@
               }
               else
               {
  -                addrs[ i ] = new InternetAddress( addr.getAddress(), addr.getName() );
  +                addrs[ i ] = new InternetAddress( addr.getAddress(), 
  +                                                  addr.getName() );
               }
           }
   
           return addrs;
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.3       +9 -5      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/PlainMailer.java
  
  Index: PlainMailer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/PlainMailer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlainMailer.java	6 Feb 2002 00:24:44 -0000	1.2
  +++ PlainMailer.java	12 Apr 2002 07:27:45 -0000	1.3
  @@ -66,12 +66,14 @@
    * Class responsible for sending email through raw protocol methods.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   class PlainMailer
       extends Mailer
   {
  -    /** Sends the email using the apache {@link org.apache.tools.mail.MailMessage MailMessage}
class.
  +    /** 
  +     * Sends the email using the apache MailMessage class.
  +     * @see org.apache.tools.mail.MailMessage
        */
       public void send()
       {
  @@ -129,7 +131,8 @@
   
       }
   
  -    /** Attaches a file to this email
  +    /** 
  +     * Attaches a file to this email
        * @param file The file to attache
        * @param out The message stream to add to
        * @throws IOException if errors occur
  @@ -140,7 +143,8 @@
           if( !file.exists() || !file.canRead() )
           {
               throw new BuildException( "File \"" + file.getName()
  -                                      + "\" does not exist or is not readable." );
  +                                      + "\" does not exist or is not "
  +                                      + "readable." );
           }
   
           if( includeFileNames )
  @@ -172,4 +176,4 @@
               finstr.close();
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +4 -3      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/UUMailer.java
  
  Index: UUMailer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/email/UUMailer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UUMailer.java	5 Feb 2002 09:32:48 -0000	1.1
  +++ UUMailer.java	12 Apr 2002 07:27:45 -0000	1.2
  @@ -65,7 +65,7 @@
    * An emailer that uuencodes attachments.
    *
    * @author roxspring@yahoo.com Rob Oxspring
  - * @since 1.5
  + * @since Ant 1.5
    */
   class UUMailer
       extends PlainMailer
  @@ -76,7 +76,8 @@
           if( !file.exists() || !file.canRead() )
           {
               throw new BuildException( "File \"" + file.getName()
  -                                      + "\" does not exist or is not readable." );
  +                                      + "\" does not exist or is not "
  +                                      + "readable." );
           }
   
           FileInputStream finstr = new FileInputStream( file );
  @@ -92,4 +93,4 @@
               finstr.close();
           }
       }
  -}
  \ No newline at end of file
  +}
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message