* (org.apache.james.imap.api.ImapMessage,
* org.apache.james.imap.encode.ImapResponseComposer,
* org.apache.james.imap.api.process.ImapSession)
*/
protected void doEncode(ImapMessage acceptableMessage, ImapResponseComposer composer, ImapSession session) throws IOException {
final ListRightsResponse listRightsResponse = (ListRightsResponse) acceptableMessage;
composer.untagged();
composer.commandName(ImapConstants.LISTRIGHTS_RESPONSE_NAME);
String mailboxName = listRightsResponse.getMailboxName();
composer.mailbox(mailboxName == null ? "" : mailboxName);
String identifier = listRightsResponse.getIdentifier();
composer.quote(identifier);
MailboxACLRights[] rights = listRightsResponse.getRights();
for (MailboxACLRights entry : rights) {
composer.quote(entry.serialize());
}
composer.end();