1 17 18 package org.apache.james.imapserver.commands; 19 20 import org.apache.james.imapserver.ImapRequest; 21 import org.apache.james.imapserver.ImapSession; 22 import org.apache.james.imapserver.ImapSessionState; 23 24 import java.util.List ; 25 26 class CloseCommand extends SelectedStateCommand 27 { 28 public CloseCommand() 29 { 30 this.commandName = "CLOSE"; 31 } 32 33 protected boolean doProcess( ImapRequest request, ImapSession session, List argValues ) 34 { 35 try { 36 session.getCurrentMailbox().expunge( session.getCurrentUser() ); 37 } 38 catch ( Exception e ) { 39 getLogger().error( "Exception while expunging mailbox on CLOSE : " + e ); 40 } 41 session.getCurrentMailbox().removeMailboxEventListener( session ); 42 session.getImapHost().releaseMailbox( session.getCurrentUser(), session.getCurrentMailbox() ); 43 session.setState( ImapSessionState.AUTHENTICATED ); 44 session.setCurrentMailbox( null ); 45 session.setCurrentIsReadOnly( false ); 46 session.okResponse( request.getCommand() ); 47 return true; 48 } 49 } 50 | Popular Tags |