james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject cvs commit: jakarta-james/src/java/org/apache/james/core MimeMessageWrapper.java
Date Mon, 04 Feb 2002 12:49:52 GMT
danny       02/02/04 04:49:52

  Modified:    src/java/org/apache/james/core Tag: v2-0a2candidate1
                        MimeMessageWrapper.java
  Log:
  not trapping exception thrown by getContentStream() in getLineCount() was causeing NotifyPostmaster()
to fail
  However trapping it hasn't made it work .. just not break anything else.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.1   +6 -2      jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java
  
  Index: MimeMessageWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java,v
  retrieving revision 1.6
  retrieving revision 1.6.2.1
  diff -u -r1.6 -r1.6.2.1
  --- MimeMessageWrapper.java	7 Dec 2001 21:53:39 -0000	1.6
  +++ MimeMessageWrapper.java	4 Feb 2002 12:49:52 -0000	1.6.2.1
  @@ -382,14 +382,18 @@
        * to avoid memory hogging.
        */
       public int getLineCount() throws MessagingException {
  -        InputStream in = getContentStream();
  +        try{
  +            InputStream in = getContentStream();
  +        }catch(Exception e){
  +            return -1;
  +        }
           if (in == null) {
               return -1;
           }
           //Wrap input stream in LineNumberReader
           //Not sure what encoding to use really...
           try {
  -            LineNumberReader counter = new LineNumberReader(new InputStreamReader(in, "ISO-8859-1"));
  +            LineNumberReader counter = new LineNumberReader(new InputStreamReader(in, getEncoding()));
               //Read through all the data
               char[] block = new char[1024];
               while (counter.read(block) > -1) {
  
  
  

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