Package org.apache.james.protocols.imap

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


            break;
        case DEC_BIT:
            result = Calendar.DECEMBER;
            break;
        default:
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Expected month name but was " + monthFirstChar + monthSecondChar + monthThirdChar);
        }
        return result;
    }
View Full Code Here


        case '3':
            return result += 30;
        case ' ':
            return result;
        }
        throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Expected SP, 0, 1, 2, or 3 but was " + dayHigh);
    }
View Full Code Here

     *             if the char is not a digit
     */
    public static int decodeDigit(char character) throws DecodingException {
        final int result = character - ASCII_ZERO;
        if (result < 0 || result > 9) {
            throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Expected a digit but was '" + character + "'");
        }
        return result;
    }
View Full Code Here

            int next = -1;

            try {
                next = input.read();
            } catch (IOException e) {
                throw new DecodingException(HumanReadableText.SOCKET_IO_FAILURE, "Error reading from stream.", e);
            }
            if (next == -1) {
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unexpected end of stream.");
            }

            nextSeen = true;
            nextChar = (char) next;
        }
View Full Code Here

            output.write('+');
            output.write('\r');
            output.write('\n');
            output.flush();
        } catch (IOException e) {
            throw new DecodingException(HumanReadableText.SOCKET_IO_FAILURE, "Unexpected exception in sending command continuation request.", e);
        }
    }
View Full Code Here

        if (extraCRLF) {
            crlf = 2;
        }
       
        if (maxLiteralSize > 0 && maxLiteralSize > size) {
            throw new DecodingException(HumanReadableText.FAILED, "Specified literal is greater then the allowed size");
        }
        // Check if we have enough data
        if (size + crlf > buffer.readableBytes()) {
            // ok let us throw a exception which till the decoder how many more
            // bytes we need
View Full Code Here

        if (!nextSeen) {
            int next;
            try {
                next = in.read();
            } catch (IOException e) {
                throw new DecodingException(HumanReadableText.SOCKET_IO_FAILURE, "Error reading from stream.", e);
            }
            if (next == -1) {
                throw new DecodingException(HumanReadableText.ILLEGAL_ARGUMENTS, "Unexpected end of stream.");
            }
            nextSeen = true;
            nextChar = (char) next;
        }
       
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.