Package org.apache.james.imapserver

Examples of org.apache.james.imapserver.ProtocolException


                byte[] messageBytes = mailString.getBytes( "US-ASCII" );
                source = new MimeMessageByteArraySource( "Mail" + System.currentTimeMillis(),
                                                         messageBytes);
            }
            catch ( Exception e ) {
                throw new ProtocolException( "UnexpectedException: " + e.getMessage() );
            }

            return new MimeMessageWrapper( source );
        }
View Full Code Here


            }
            else if ( nextWord.equals( UNSEEN ) ) {
                items.unseen = true;
            }
            else {
                throw new ProtocolException( "Unknown status item: '" + nextWord + "'" );
            }
        }
View Full Code Here

                String value = atom( request );
                if ( "NIL".equals( value ) ) {
                    return null;
                }
                else {
                    throw new ProtocolException( "Invalid nstring value: valid values are '\"...\"', '{12} CRLF *CHAR8', and 'NIL'." );
                }
        }
    }
View Full Code Here

        String dateString;
        if ( next == '"' ) {
            dateString = consumeQuoted( request );
        }
        else {
            throw new ProtocolException( "DateTime values must be quoted." );
        }

        DateFormat dateFormat = new SimpleDateFormat( "dd-MMM-yyyy hh:mm:ss zzzz" );
        try {
            return dateFormat.parse( dateString );
        }
        catch ( ParseException e ) {
            throw new ProtocolException( "Invalid date format." );
        }
    }
View Full Code Here

        DateFormat dateFormat = new SimpleDateFormat( "dd-MMM-yyyy" );
        try {
            return dateFormat.parse( dateString );
        }
        catch ( ParseException e ) {
            throw new ProtocolException( "Invalid date format." );
        }
    }
View Full Code Here

            {
                atom.append( next );
                request.consume();
            }
            else {
                throw new ProtocolException( "Invalid character: '" + next + "'" );
            }
            next = request.nextChar();
        }
        return atom.toString();
    }
View Full Code Here

    protected void consumeChar( ImapRequestLineReader request, char expected )
            throws ProtocolException
    {
        char consumed = request.consume();
        if ( consumed != expected ) {
            throw new ProtocolException( "Expected:'" + expected + "' found:'" + consumed + "'" );
        }
    }
View Full Code Here

        while( next != '"' ) {
            if ( next == '\\' ) {
                request.consume();
                next = request.nextChar();
                if ( ! isQuotedSpecial( next ) ) {
                    throw new ProtocolException( "Invalid escaped character in quote: '" +
                                                 next + "'" );
                }
            }
            quoted.append( next );
            request.consume();
View Full Code Here

        }
        else if ( flagString.equalsIgnoreCase( MessageFlags.SEEN ) ) {
            flags.setSeen( true );
        }
        else {
            throw new ProtocolException( "Invalid flag string." );
        }
    }
View Full Code Here

     */
    public long nzNumber( ImapRequestLineReader request ) throws ProtocolException
    {
        long number = number( request );
        if ( number == 0 ) {
            throw new ProtocolException( "Zero value not permitted." );
        }
        return number;
    }
View Full Code Here

TOP

Related Classes of org.apache.james.imapserver.ProtocolException

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.