Package org.jwall.web.http

Examples of org.jwall.web.http.ProtocolException


     */
    public HttpHeader readHeader() throws TimeOutException, IOException, ProtocolException {
        log.debug("Entering HttpRequestStream.readHeader()");
       
        if( state == STATE_READING_BODY )
            throw new ProtocolException("Last header indicated a message-body - need to read that first!");

        String line = in.readLine();

        if( line == null ){
            //
View Full Code Here


     *         method was called in an incorrect state (reading header state).
     */
    public ByteBuffer readBody( int contentLength ) throws IOException, TimeOutException, ProtocolException {
       
        if( state == STATE_READING_HEADER )
            throw new ProtocolException("You're trying to read a message body, but should read a header!");

       
        if( this.body == null ){
            //
            // this is the first try, so we start by allocating
View Full Code Here

            }
           
        }

        if( header == null )
            throw new ProtocolException("No header available, though state shows being AFTER reading-header...");

        if( header != null && state == STATE_CLOSE_CONNECTION ){
            //
            // ok, the server closes the connection, thus the body contains all data
            // that will be sent until we read 0/EOF bytes...
View Full Code Here

                    }

                    return new HttpChunk( line, chunk );

                } else {
                    throw new ProtocolException( this + ": Error, expected blank-line after chunk, found: " + l );
                }
            }
        }

        log.debug( this + ": Reading chunk not completed." );
View Full Code Here

TOP

Related Classes of org.jwall.web.http.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.