james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r995175 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
Date Wed, 08 Sep 2010 18:03:37 GMT
Author: norman
Date: Wed Sep  8 18:03:37 2010
New Revision: 995175

URL: http://svn.apache.org/viewvc?rev=995175&view=rev
Log:
move rename of INBOX handling to processor to make the mailbox implementation not imap specific
(IMAP-208)

Modified:
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java

Modified: james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java?rev=995175&r1=995174&r2=995175&view=diff
==============================================================================
--- james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
(original)
+++ james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
Wed Sep  8 18:03:37 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.processor;
 
-import javax.mail.Flags;
-
 import org.apache.james.imap.api.ImapCommand;
 import org.apache.james.imap.api.ImapConstants;
 import org.apache.james.imap.api.ImapMessage;
@@ -61,6 +59,7 @@ public class RenameProcessor extends Abs
             MailboxSession mailboxsession = ImapSessionUtils.getMailboxSession(session);
             if (existingPath.getName().equalsIgnoreCase(ImapConstants.INBOX_NAME)) {
 
+                
                 // if the mailbox is INBOX we need to move move the messages
                 // https://issues.apache.org/jira/browse/IMAP-188                       
   
                 MessageRange range = MessageRange.all();
@@ -69,10 +68,9 @@ public class RenameProcessor extends Abs
                     mailboxManager.createMailbox(newPath, mailboxsession);
                 }
                 mailboxManager.copyMessages(range, existingPath, newPath, mailboxsession);
-                
-                org.apache.james.mailbox.MessageManager inbox = mailboxManager.getMailbox(existingPath,
mailboxsession);
-                inbox.setFlags(new Flags(Flags.Flag.DELETED), true, false, range, mailboxsession);
-                inbox.expunge(range, mailboxsession);
+                mailboxManager.deleteMailbox(existingPath, mailboxsession);
+                mailboxManager.createMailbox(existingPath, mailboxsession);
+              
             } else {
                 mailboxManager.renameMailbox(existingPath, newPath, mailboxsession);
             }



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