@Test(expected = DecodingException.class) public void decodeMessageShouldThrowDecodingExceptionWhenCommandAnnotationValueNotInQuote() throws DecodingException { InputStream inputStream = new ByteArrayInputStream((INBOX + " (/private/comment This is my comment) \n").getBytes()); ImapRequestStreamLineReader lineReader = new ImapRequestStreamLineReader(inputStream, null); parser.decode(lineReader, TAG, null); }
@Override protected ImapMessage decode(ImapRequestLineReader request, Tag tag, ImapSession session) throws DecodingException { String mailboxName = request.mailbox(); ImmutableList.Builder<MailboxAnnotation> listMailboxAnnotations = ImmutableList.<MailboxAnnotation>builder(); if (request.nextWordChar() == '(') { request.consumeChar('('); do { listMailboxAnnotations.add(readNextAnnotation(request)); } while (request.nextWordChar() != ')'); request.consumeChar(')'); } request.eol(); return new SetAnnotationRequest(tag, mailboxName, listMailboxAnnotations.build()); }
SetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader request, Tag tag, ImapSession session) throws DecodingException { String mailboxName = request.mailbox(); ImmutableList.Builder<MailboxAnnotation> listMailboxAnnotations = ImmutableList.<MailboxAnnotation>builder(); if (request.nextWordChar() == '(') { request.consumeChar('('); do { listMailboxAnnotations.add(readNextAnnotation(request)); } while (request.nextWordChar() != ')'); request.consumeChar(')'); } request.eol(); return new SetAnnotationRequest(tag, mailboxName, listMailboxAnnotations.build()); } }
SetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader request, Tag tag, ImapSession session) throws DecodingException { String mailboxName = request.mailbox(); ImmutableList.Builder<MailboxAnnotation> listMailboxAnnotations = ImmutableList.<MailboxAnnotation>builder(); if (request.nextWordChar() == '(') { request.consumeChar('('); do { listMailboxAnnotations.add(readNextAnnotation(request)); } while (request.nextWordChar() != ')'); request.consumeChar(')'); } request.eol(); return new SetAnnotationRequest(tag, mailboxName, listMailboxAnnotations.build()); } SetAnnotationCommandParser(StatusResponseFactory statusResponseFactory); }
SetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader request, Tag tag, ImapSession session) throws DecodingException { String mailboxName = request.mailbox(); ImmutableList.Builder<MailboxAnnotation> listMailboxAnnotations = ImmutableList.<MailboxAnnotation>builder(); if (request.nextWordChar() == '(') { request.consumeChar('('); do { listMailboxAnnotations.add(readNextAnnotation(request)); } while (request.nextWordChar() != ')'); request.consumeChar(')'); } request.eol(); return new SetAnnotationRequest(tag, mailboxName, listMailboxAnnotations.build()); } SetAnnotationCommandParser(StatusResponseFactory statusResponseFactory);  }
SetAnnotationCommandParser extends AbstractImapCommandParser { @Override protected ImapMessage decode(ImapRequestLineReader request, Tag tag, ImapSession session) throws DecodingException { String mailboxName = request.mailbox(); ImmutableList.Builder<MailboxAnnotation> listMailboxAnnotations = ImmutableList.<MailboxAnnotation>builder(); if (request.nextWordChar() == '(') { request.consumeChar('('); do { listMailboxAnnotations.add(readNextAnnotation(request)); } while (request.nextWordChar() != ')'); request.consumeChar(')'); } request.eol(); return new SetAnnotationRequest(tag, mailboxName, listMailboxAnnotations.build()); } SetAnnotationCommandParser(StatusResponseFactory statusResponseFactory);   }