Examples of DecodingException


Examples of org.apache.james.protocols.imap.DecodingException

                    request.nextWordChar();
                    options = parseOptions(request);
                    break;

                default:
                    throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown search key");
                }
            }
            final SearchKey finalKey;

            if (recent != null) {
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

        if ("FLAGS".equalsIgnoreCase(directive)) {
            silent = false;
        } else if ("FLAGS.SILENT".equalsIgnoreCase(directive)) {
            silent = true;
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Invalid Store Directive: '" + directive + "'");
        }

        // Handle all kind of "store-att-flags"
        // See IMAP-281
        final Flags flags = new Flags();
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            } else if ("RFC822.TEXT".equalsIgnoreCase(name)) {
                fetch.add(BodyFetchElement.createRFC822Text(), false);
            } else if ("MODSEQ".equalsIgnoreCase(name)) {
                fetch.setModSeq(true);
            } else {
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Invalid fetch attribute: " + name);
            }
        } else {
            reader.consumeChar('[');

            String parameter = readWord(reader, "]");
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

        if ("BODY".equalsIgnoreCase(name)) {
            isPeek = false;
        } else if ("BODY.PEEK".equalsIgnoreCase(name)) {
            isPeek = true;
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Invalid fetch attibute: " + name + "[]");
        }
        return isPeek;
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            break;
        case FetchPartPathDecoder.TEXT:
            sectionType = BodyFetchElement.TEXT;
            break;
        default:
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Section type is unsupported.");
        }
        return sectionType;
    }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

        // Check if we have VANISHED and and UID FETCH as its only allowed there
        //
        // See RFC5162 3.2. VANISHED UID FETCH Modifier
        if (fetch.getVanished() && !useUids) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "VANISHED only allowed in UID FETCH");
        }
       
        request.eol();

        final ImapMessage result = new FetchRequest(command, useUids, idSet, fetch, tag);
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            case 'C':
                // It starts with C so it should be CONDSTORE
                int pos = 0;
                while (pos < CONDSTORE.length) {
                    if (CONDSTORE[pos++] != ImapRequestLineReader.cap(request.consume())) {
                        throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown option");
                    }
                }
                condstore = true;
                break;
            case 'Q':
                // It starts with Q so it should be QRESYNC
                request.consumeWord(new CharacterValidator() {
                    int pos = 0;

                    public boolean isValid(char chr) {
                        if (pos >= QRESYNC.length) {
                            return false;
                        } else {
                            return ImapRequestLineReader.cap(chr) == QRESYNC[pos++];
                        }
                    }
                });
               
                // Consume the SP
                request.consumeChar(' ');
               
                // Consume enclosing paren
                request.consumeChar('(');
                lastKnownUidValidity = request.number();
               
                // Consume the SP
                request.consumeChar(' ');
                knownModSeq = request.number(true);
               
                char nc = request.nextChar();
                if (nc == ' ') {
                    // All this stuff is now optional
                      
                    // Consume the SP
                    request.consumeChar(' ');
                    uidSet = request.parseIdRange();
                   
                    // Check for *
                    checkIdRanges(uidSet, false);
                   
                    nc = request.nextChar();
                    if (nc == ' ')  {
                        request.consumeChar(' ');
                       
                        // This is enclosed in () so remove (
                        request.consumeChar('(');
                        knownSequenceSet = request.parseIdRange();
                        request.consumeChar(' ');
                        knownUidSet = request.parseIdRange();
                      
                        // Check for * and check if its in ascending order
                        checkIdRanges(knownSequenceSet, true);
                        checkIdRanges(knownUidSet, true);
                       
                        // This is enclosed in () so remove )
                        request.consumeChar(')');
                    }
                }
                request.consumeChar(')');

                break;
            default:
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown option");
            }

            request.consumeChar(')');

        }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

           
            IdRange r = ranges[i];
            long low = r.getLowVal();
            long high = r.getHighVal();
            if (low == Long.MAX_VALUE || high == Long.MAX_VALUE) {
                throw new DecodingException(HumanReadableText.INVALID_MESSAGESET, "* is not allowed in the sequence-set");
            }
            if (checkOrder) {
                if (low < last) {
                    throw new DecodingException(HumanReadableText.INVALID_MESSAGESET, "Sequence-set must be in ascending order");
                } else {
                    last = high;
                }
            }
        }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            case 'M':
                result = mime(at, sectionSpecification);
                break;

            default:
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Did not expect '" + next + "' here in body specification.");
            }
        } else {
            storePartial();
            result = CONTENT;
        }
View Full Code Here

Examples of org.apache.james.protocols.imap.DecodingException

            mustBeI(sectionSpecification, at + 1);
            mustBeM(sectionSpecification, at + 2);
            mustBeE(sectionSpecification, at + 3);
            storePartial();
        } else {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
        return MIME;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.