james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r940037 - /james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java
Date Sat, 01 May 2010 14:26:13 GMT
Author: norman
Date: Sat May  1 14:26:13 2010
New Revision: 940037

URL: http://svn.apache.org/viewvc?rev=940037&view=rev
Log:
Dispose the mail after its stored to the filesystem. This is needed because otherwise streams
will keeped open and so we get problems when trying to rename it later on windows

Modified:
    james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java

Modified: james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java
URL: http://svn.apache.org/viewvc/james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java?rev=940037&r1=940036&r2=940037&view=diff
==============================================================================
--- james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java
(original)
+++ james/server/trunk/spoolmanager/src/main/java/org/apache/james/transport/camel/MailClaimCheck.java
Sat May  1 14:26:13 2010
@@ -28,6 +28,7 @@ import javax.mail.internet.MimeMessage;
 import org.apache.camel.Body;
 import org.apache.camel.Exchange;
 import org.apache.james.SpoolMessageStore;
+import org.apache.james.lifecycle.LifecycleUtil;
 import org.apache.mailet.Mail;
 
 /**
@@ -48,7 +49,7 @@ public final class MailClaimCheck {
     
     
     /**
-     * Save the Email Message to an external storage
+     * Save the Email Message to an external storage and dispose it 
      * 
      * @param exchange
      * @param mail
@@ -67,6 +68,12 @@ public final class MailClaimCheck {
         
             // close stream
             out.close();
+            
+            // dispose the mail now, to make sure every stream is closed etc
+            // Without that we will get a problem on windows later..
+            LifecycleUtil.dispose(m);
+            LifecycleUtil.dispose(mail);
+            
         }
         
     }



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


Mime
View raw message