Package org.archive.wayback.util.http

Examples of org.archive.wayback.util.http.BadRequestException


    while(pos < max) {
      int next = in.read();
      buffer[pos] = (byte) next;
      if(next == LF) {
        if(pos == 0) {
          throw new BadRequestException(
              "Message cannot start with LF");
        }
        if(buffer[pos - 1] == CR) {
          found = true;
          break;
        }
      }
      pos++;
    }
    if(!found) {
      throw new BadRequestException("Message too long without CRLF");
    }
    return ByteOp.copy(buffer,0,pos+1);
  }
View Full Code Here


        break;
      }
      offset++;
    }
    if(found != max - 1) {
      throw new BadRequestException("Not enough fields(" + found +") " +
          "want("+max+") in (" + new String(buffer)+ ")");
    }
    return spaces;
  }
View Full Code Here

   
    byte[] buffer = new byte[MAX_HEADER_SIZE];

    int r = in.read(buffer, 0, MAX_HEADER_SIZE);
    if(r == MAX_HEADER_SIZE) {
      throw new BadRequestException("Request too long");
    }
    return new HttpRequest(message, ByteOp.copy(buffer,0,r));
  }
View Full Code Here

    while(pos < max) {
      int next = in.read();
      buffer[pos] = (byte) next;
      if(next == LF) {
        if(pos == 0) {
          throw new BadRequestException(
              "Message cannot start with LF");
        }
        if(buffer[pos - 1] == CR) {
          found = true;
          break;
        }
      }
      pos++;
    }
    if(!found) {
      throw new BadRequestException("Message too long without CRLF");
    }
    return ByteOp.copy(buffer,0,pos+1);
  }
View Full Code Here

        break;
      }
      offset++;
    }
    if(found != max - 1) {
      throw new BadRequestException("Not enough fields(" + found +") " +
          "want("+max+") in (" + new String(buffer)+ ")");
    }
    return spaces;
  }
View Full Code Here

   
    byte[] buffer = new byte[MAX_HEADER_SIZE];

    int r = in.read(buffer, 0, MAX_HEADER_SIZE);
    if(r == MAX_HEADER_SIZE) {
      throw new BadRequestException("Request too long");
    }
    return new HttpRequest(message, ByteOp.copy(buffer,0,r));
  }
View Full Code Here

TOP

Related Classes of org.archive.wayback.util.http.BadRequestException

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.