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/email/xdocs changes.xml
Date Mon, 29 Nov 2004 09:59:12 GMT
epugh       2004/11/29 01:59:12

  Modified:    email/src/test/org/apache/commons/mail HtmlEmailTest.java
                        SendWithAttachmentsTest.java
                        MultiPartEmailTest.java SimpleEmailTest.java
               email    project.properties
               email/xdocs changes.xml
  Added:       email/src/java/org/apache/commons/mail
                        ByteArrayDataSource.java
  Log:
  BugZilla submitted fixes.
  
  Revision  Changes    Path
  1.2       +5 -1      jakarta-commons/email/src/test/org/apache/commons/mail/HtmlEmailTest.java
  
  Index: HtmlEmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/src/test/org/apache/commons/mail/HtmlEmailTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HtmlEmailTest.java	25 Nov 2004 11:14:53 -0000	1.1
  +++ HtmlEmailTest.java	29 Nov 2004 09:59:11 -0000	1.2
  @@ -254,6 +254,7 @@
   
               this.email = new MockHtmlEmailConcrete();
               this.email.setHostName(this.strTestMailServer);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.setFrom(this.strTestMailFrom);
               this.email.addTo(this.strTestMailTo);
   
  @@ -335,6 +336,7 @@
   
               this.email = new MockHtmlEmailConcrete();
               this.email.setHostName(this.strTestMailServer);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.setFrom(this.strTestMailFrom);
               this.email.addTo(this.strTestMailTo);
   
  @@ -386,6 +388,7 @@
   
               this.email = new MockHtmlEmailConcrete();
               this.email.setHostName(this.strTestMailServer);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.setFrom(this.strTestMailFrom);
               this.email.addTo(this.strTestMailTo);
   
  @@ -441,6 +444,7 @@
               this.email = new MockHtmlEmailConcrete();
               this.email.setHostName(this.strTestMailServer);
               this.email.setFrom(this.strTestMailFrom);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.addTo(this.strTestMailTo);
   
               if (this.strTestUser != null && this.strTestPasswd != null)
  
  
  
  1.2       +3 -1      jakarta-commons/email/src/test/org/apache/commons/mail/SendWithAttachmentsTest.java
  
  Index: SendWithAttachmentsTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/src/test/org/apache/commons/mail/SendWithAttachmentsTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SendWithAttachmentsTest.java	25 Nov 2004 11:14:53 -0000	1.1
  +++ SendWithAttachmentsTest.java	29 Nov 2004 09:59:11 -0000	1.2
  @@ -64,6 +64,7 @@
   
               this.email = new MockHtmlEmailConcrete();
               this.email.setHostName(this.strTestMailServer);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.setFrom(this.strTestMailFrom);
               this.email.addTo(this.strTestMailTo);
   
  @@ -153,6 +154,7 @@
   
   			this.email = new MockHtmlEmailConcrete();
   			this.email.setHostName(this.strTestMailServer);
  +			this.email.setSmtpPort(this.intTestMailServerPort);
   			this.email.setFrom(this.strTestMailFrom);
   			this.email.addTo(this.strTestMailTo);
   
  
  
  
  1.2       +2 -1      jakarta-commons/email/src/test/org/apache/commons/mail/MultiPartEmailTest.java
  
  Index: MultiPartEmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/src/test/org/apache/commons/mail/MultiPartEmailTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MultiPartEmailTest.java	25 Nov 2004 11:14:53 -0000	1.1
  +++ MultiPartEmailTest.java	29 Nov 2004 09:59:11 -0000	1.2
  @@ -148,6 +148,7 @@
               MockMultiPartEmailConcrete testEmail =
                   new MockMultiPartEmailConcrete();
               testEmail.setHostName(this.strTestMailServer);
  +            testEmail.setSmtpPort(this.intTestMailServerPort);
               testEmail.setFrom(this.strTestMailFrom);
               testEmail.addTo(this.strTestMailTo);
               testEmail.attach(attachment);
  
  
  
  1.2       +2 -1      jakarta-commons/email/src/test/org/apache/commons/mail/SimpleEmailTest.java
  
  Index: SimpleEmailTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/src/test/org/apache/commons/mail/SimpleEmailTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SimpleEmailTest.java	25 Nov 2004 11:14:53 -0000	1.1
  +++ SimpleEmailTest.java	29 Nov 2004 09:59:11 -0000	1.2
  @@ -104,6 +104,7 @@
   
               this.email = new MockSimpleEmail();
               this.email.setHostName(this.strTestMailServer);
  +            this.email.setSmtpPort(this.intTestMailServerPort);
               this.email.setFrom(this.strTestMailFrom);
               this.email.addTo(this.strTestMailTo);
   
  
  
  
  1.1                  jakarta-commons/email/src/java/org/apache/commons/mail/ByteArrayDataSource.java
  
  Index: ByteArrayDataSource.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.commons.mail;
  
  import java.io.BufferedInputStream;
  import java.io.BufferedOutputStream;
  import java.io.ByteArrayInputStream;
  import java.io.ByteArrayOutputStream;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.UnsupportedEncodingException;
  
  import javax.activation.DataSource;
  
  /**
   * This class implements a typed DataSource from:<br>
   *
   * - an InputStream<br>
   * - a byte array<br>
   * - a String<br>
   *
   * @author <a href="mailto:colin.chalmers@maxware.nl">Colin Chalmers</a>
   * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
   * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
   * @version $Id: ByteArrayDataSource.java,v 1.1 2004/11/29 09:59:11 epugh Exp $
   */
  public class ByteArrayDataSource implements DataSource
  {
      /** Stream containg the Data */
      private ByteArrayOutputStream baos = null;
  
      /** Content-type. */
      private String type = "application/octet-stream";
  
      /** define the buffer size */
      public static final int BUFFER_SIZE = 512;
  
      /**
       * Create a datasource from a byte array.
       *
       * @param data A byte[].
       * @param aType A String.
       * @throws IOException IOException
       */
      public ByteArrayDataSource(byte[] data, String aType) throws IOException
      {
          ByteArrayInputStream bis = null;
  
          try
          {
              bis = new ByteArrayInputStream(data);
              this.byteArrayDataSource(bis, aType);
          }
          catch (IOException ioex)
          {
              throw ioex;
          }
          finally
          {
              if (bis != null)
              {
                  bis.close();
              }
          }
      }
  
      /**
       * Create a datasource from an input stream.
       *
       * @param aIs An InputStream.
       * @param aType A String.
       * @throws IOException IOException
       */
      public ByteArrayDataSource(InputStream aIs, String aType) throws IOException
      {
          this.byteArrayDataSource(aIs, aType);
      }
  
      /**
        * Create a datasource from an input stream.
        *
        * @param aIs An InputStream.
        * @param aType A String.
        * @throws IOException IOException
        */
      private void byteArrayDataSource(InputStream aIs, String aType)
          throws IOException
      {
          this.type = aType;
  
          BufferedInputStream bis = null;
          BufferedOutputStream osWriter = null;
  
          try
          {
              int length = 0;
              byte[] buffer = new byte[ByteArrayDataSource.BUFFER_SIZE];
  
              bis = new BufferedInputStream(aIs);
              baos = new ByteArrayOutputStream();
              osWriter = new BufferedOutputStream(baos);
  
              //Write the InputData to OutputStream
              while ((length = bis.read(buffer)) != -1)
              {
                  osWriter.write(buffer, 0, length);
              }
              osWriter.flush();
              osWriter.close();
  
          }
          catch (IOException ioex)
          {
              throw ioex;
          }
          finally
          {
              if (bis != null)
              {
                  bis.close();
              }
              if (baos != null)
              {
                  baos.close();
              }
              if (osWriter != null)
              {
                  osWriter.close();
              }
          }
      }
  
      /**
       * Create a datasource from a String.
       *
       * @param data A String.
       * @param aType A String.
       * @throws IOException IOException
       */
      public ByteArrayDataSource(String data, String aType) throws IOException
      {
          this.type = aType;
  
          try
          {
              baos = new ByteArrayOutputStream();
  
              // Assumption that the string contains only ASCII
              // characters!  Else just pass in a charset into this
              // constructor and use it in getBytes().
              baos.write(data.getBytes("iso-8859-1"));
              baos.flush();
              baos.close();
          }
          catch (UnsupportedEncodingException uex)
          {
              throw new IOException("The Character Encoding is not supported.");
          }
          finally
          {
              if (baos != null)
              {
                  baos.close();
              }
          }
      }
  
      /**
       * Get the content type.
       *
       * @return A String.
       */
      public String getContentType()
      {
          return (type == null ? "application/octet-stream" : type);
      }
  
      /**
       * Get the input stream.
       *
       * @return An InputStream.
       * @throws IOException IOException
       */
      public InputStream getInputStream() throws IOException
      {
          if (baos == null)
          {
              throw new IOException("no data");
          }
          return new ByteArrayInputStream(baos.toByteArray());
      }
  
      /**
       * Get the name.
       *
       * @return A String.
       */
      public String getName()
      {
          return "ByteArrayDataSource";
      }
  
      /**
       * Get the OutputStream to write to
       *
       * @return  An OutputStream
       * @throws  IOException IOException
       */
      public OutputStream getOutputStream() throws IOException
      {
          baos = new ByteArrayOutputStream();
          return baos;
      }
  }
  
  
  1.3       +4 -4      jakarta-commons/email/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/project.properties,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.properties	27 Nov 2004 16:54:32 -0000	1.2
  +++ project.properties	29 Nov 2004 09:59:11 -0000	1.3
  @@ -40,6 +40,6 @@
   maven.xdoc.developmentProcessUrl=http://jakarta.apache.org/commons/charter.html
   
   # Use included jars
  -maven.jar.override=true
  -maven.jar.activation = ${basedir}/lib/activation-1.0.2.jar
  -maven.jar.javamail = ${basedir}/lib/javamail-1.3.2.jar
  \ No newline at end of file
  +#maven.jar.override=true
  +#maven.jar.activation = ${basedir}/lib/activation-1.0.2.jar
  +#maven.jar.javamail = ${basedir}/lib/javamail-1.3.2.jar
  \ No newline at end of file
  
  
  
  1.2       +6 -4      jakarta-commons/email/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/email/xdocs/changes.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- changes.xml	25 Nov 2004 09:56:56 -0000	1.1
  +++ changes.xml	29 Nov 2004 09:59:11 -0000	1.2
  @@ -6,10 +6,12 @@
     </properties>
   
     <body>
  -    <release version="1.0" date="IN CVS">
  -      <action dev="epugh" type="add">
  -        Add to /lib required jars not on Ibiblio.  Tweak Ant and Maven builds to include
  -        them.
  +    <release version="1.0" date="IN CVS"> 
  +      <action dev="epugh" type="add" due-to="Corey Scott" issue="32410">
  +        Change port for dumbster from 25 to 2500 to use unreserved port.
  +      </action>              
  +      <action dev="epugh" type="add" due-to="Corey Scott" issue="32260">
  +        Add back in ByteArrayDataSource.
         </action>
         <action dev="epugh" type="remove">
           Removed deprecated MailMessage and ByteArrayDataSource.
  
  
  

---------------------------------------------------------------------
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