james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pgoldst...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/core MimeMessageInputStreamSource.java
Date Tue, 03 Sep 2002 16:52:16 GMT
pgoldstein    2002/09/03 09:52:16

  Modified:    src/java/org/apache/james/core
                        MimeMessageInputStreamSource.java
  Log:
  Fixed issue where MimeMessageInputStreamSource was throwing a generic RuntimeException when
it
  should have been throwing a MessagingException.
  
  Thanks to Noel Bergman for the submission
  
  Revision  Changes    Path
  1.8       +7 -6      jakarta-james/src/java/org/apache/james/core/MimeMessageInputStreamSource.java
  
  Index: MimeMessageInputStreamSource.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageInputStreamSource.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MimeMessageInputStreamSource.java	17 Aug 2002 18:16:24 -0000	1.7
  +++ MimeMessageInputStreamSource.java	3 Sep 2002 16:52:16 -0000	1.8
  @@ -8,6 +8,7 @@
   package org.apache.james.core;
   
   import java.io.*;
  +import javax.mail.MessagingException;
   
   /**
    * Takes an input stream and creates a repeatable input stream source
  @@ -19,10 +20,6 @@
    *
    *
    * @author <a href="mailto:sergek@lokitech.com>">Serge Knystautas</a>
  - *
  - * Modified by <a href="mailto:okidz@pindad.com">Oki DZ</a>
  - * Thu Oct  4 15:15:27 WIT 2001
  - *
    */
   public class MimeMessageInputStreamSource extends MimeMessageSource {
   
  @@ -43,8 +40,12 @@
        *
        * @param key the prefix for the name of the temp file
        * @param in the stream containing the MimeMessage
  +     *
  +     * @throws MessagingException if an error occurs while trying to store
  +     *                            the stream
        */
  -    public MimeMessageInputStreamSource(String key, InputStream in) {
  +    public MimeMessageInputStreamSource(String key, InputStream in)
  +            throws MessagingException {
           //We want to immediately read this into a temporary file
           //Create a temp file and channel the input stream into it
           OutputStream fout = null;
  @@ -60,7 +61,7 @@
   
               sourceId = file.getCanonicalPath();
           } catch (IOException ioe) {
  -            throw new RuntimeException("Unable to retrieve the data: " + ioe.getMessage());
  +            throw new MessagingException("Unable to retrieve the data: " + ioe.getMessage(),
ioe);
           } finally {
               try {
                   if (fout != null) {
  
  
  

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


Mime
View raw message