Package org.apache.james.protocols.imap

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


            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

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

            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

           
            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

            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

            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

    }

    private void mustBeI(CharSequence sectionSpecification, int position) throws DecodingException {
        final char i = sectionSpecification.charAt(position);
        if (!(i == 'i' || i == 'I')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

    }

    private void mustBeM(CharSequence sectionSpecification, int position) throws DecodingException {
        final char next = sectionSpecification.charAt(position);
        if (!(next == 'm' || next == 'M')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

    }

    private void mustBeN(CharSequence sectionSpecification, int position) throws DecodingException {
        final char next = sectionSpecification.charAt(position);
        if (!(next == 'n' || next == 'N')) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unknown body specification");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.james.protocols.imap.DecodingException

Copyright © 2018 www.massapicom. 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.