james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/core MailImpl.java
Date Mon, 06 Aug 2001 03:39:23 GMT
serge       01/08/05 20:39:23

  Modified:    src/java/org/apache/james/core MailImpl.java
  Log:
  Removed parse(InputStream) and setMessage(InputStream). Uses MimeMessageInputStreamSource
if the source is an inputstream.
  
  Revision  Changes    Path
  1.2       +6 -16     jakarta-james/src/java/org/apache/james/core/MailImpl.java
  
  Index: MailImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MailImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MailImpl.java	2001/05/11 09:15:43	1.1
  +++ MailImpl.java	2001/08/06 03:39:22	1.2
  @@ -49,7 +49,9 @@
       public MailImpl(String name, MailAddress sender, Collection recipients, InputStream
messageIn)
       throws MessagingException {
           this(name, sender, recipients);
  -        this.setMessage(messageIn);
  +        MimeMessageSource source = new MimeMessageInputStreamSource(name, messageIn);
  +        MimeMessageWrapper wrapper = new MimeMessageWrapper(source);
  +        this.setMessage(wrapper);
       }
   
       public MailImpl(String name, MailAddress sender, Collection recipients, MimeMessage
message) {
  @@ -117,14 +119,6 @@
           return lastUpdated;
       }
   
  -    private void parse(InputStream messageIn) throws MessagingException {
  -        if (messageIn != null) {
  -            message = new EnhancedMimeMessage(Session.getDefaultInstance(System.getProperties(),
null), messageIn);
  -        } else {
  -	    throw new MessagingException("Attempt to parse null input stream.");
  -	}
  -    }
  -
       /**
        * <p>Return the size of the message including its headers.
        * MimeMessage.getSize() method only returns the size of the
  @@ -147,7 +141,7 @@
               size += ((Header)e.nextElement()).toString().length();
            }
           return size;
  -     }
  +    }
   
       private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
{
           try {
  @@ -168,10 +162,6 @@
           this.errorMessage = msg;
       }
   
  -    public void setMessage(InputStream in) throws MessagingException {
  -        this.message = new JamesMimeMessage(Session.getDefaultInstance(System.getProperties(),
null), in);
  -    }
  -
       public void setMessage(MimeMessage message) {
           this.message = message;
       }
  @@ -250,7 +240,7 @@
                   out.write(line.getBytes());
               }
           } else {
  -	    throw new MessagingException("No message set for this MailImpl.");
  -	}
  +    	    throw new MessagingException("No message set for this MailImpl.");
  +        }
       }
   }
  
  
  

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


Mime
View raw message