james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r995531 - /james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
Date Thu, 09 Sep 2010 18:32:47 GMT
Author: norman
Date: Thu Sep  9 18:32:47 2010
New Revision: 995531

URL: http://svn.apache.org/viewvc?rev=995531&view=rev
Log:
better handling of INBOX rename (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=995531&r1=995530&r2=995531&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
Thu Sep  9 18:32:47 2010
@@ -35,7 +35,6 @@ import org.apache.james.mailbox.MailboxM
 import org.apache.james.mailbox.MailboxNotFoundException;
 import org.apache.james.mailbox.MailboxPath;
 import org.apache.james.mailbox.MailboxSession;
-import org.apache.james.mailbox.MessageRange;
 
 public class RenameProcessor extends AbstractMailboxProcessor {
 
@@ -57,22 +56,13 @@ public class RenameProcessor extends Abs
         try {
             final MailboxManager mailboxManager = getMailboxManager();
             MailboxSession mailboxsession = ImapSessionUtils.getMailboxSession(session);
-            if (existingPath.getName().equalsIgnoreCase(ImapConstants.INBOX_NAME)) {
+            mailboxManager.renameMailbox(existingPath, newPath, mailboxsession);
 
-                
-                // if the mailbox is INBOX we need to move move the messages
-                // https://issues.apache.org/jira/browse/IMAP-188                       
   
-                MessageRange range = MessageRange.all();
-                // create the mailbox if it not exist yet
-                if (mailboxManager.mailboxExists(newPath, mailboxsession) == false) {
-                    mailboxManager.createMailbox(newPath, mailboxsession);
+            if (existingPath.getName().equalsIgnoreCase(ImapConstants.INBOX_NAME)) {
+                if (mailboxManager.mailboxExists(existingPath, mailboxsession) == false)
{
+                    mailboxManager.createMailbox(existingPath, mailboxsession);
                 }
-                mailboxManager.copyMessages(range, existingPath, newPath, mailboxsession);
-                mailboxManager.deleteMailbox(existingPath, mailboxsession);
-                mailboxManager.createMailbox(existingPath, mailboxsession);
               
-            } else {
-                mailboxManager.renameMailbox(existingPath, newPath, mailboxsession);
             }
             okComplete(command, tag, responder);
             unsolicitedResponses(session, responder, false);



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