Package com.firefly.server.exception

Examples of com.firefly.server.exception.HttpServerException


  }

  @Override
  public void addCookie(Cookie cookie) {
    if (cookie == null)
      throw new HttpServerException("cookie is null");

    if (VerifyUtils.isNotEmpty(cookie.getName())
        && VerifyUtils.isNotEmpty(cookie.getValue())) {
      cookies.add(cookie);
    } else {
      throw new HttpServerException(
          "cookie name or value or domain is null");
    }
  }
View Full Code Here


   
    for (int len = 0; ((len = input.readLine(buf, 0, buf.length)) != -1);) {
      switch (status) {
      case BOUNDARY:
        if(buf[len - 1] != '\n')
          throw new HttpServerException("boundary format error");
       
        String currentBoundary = new String(buf, 0, len, charset).trim();
        buf = new byte[headBufSize];
       
        if(!currentBoundary.equals("--" + boundary))
          throw new HttpServerException("boundary [" + currentBoundary + "] format error");
     
        part = new PartImpl();
        status = Status.HEAD;
        break;
       
      case HEAD:
        if(buf[len - 1] != '\n')
          throw new HttpServerException("head format error");
       
        String headInfo = new String(buf, 0, len, charset).trim();
        if(VerifyUtils.isEmpty(headInfo)) {
          buf = new byte[dataBufSize];
          status = Status.DATA;
          break;
        }
       
        buf = new byte[headBufSize];
       
        String[] t = StringUtils.split(headInfo, ":", 2);
        if(t.length != 2)
          throw new HttpServerException("head [" + headInfo + "] format error");

        part.headMap.put(t[0].toLowerCase(), t[1]);
        break;
       
      case DATA:
View Full Code Here

    return requestDispatcher;
  }
 
  @Override
  public ServletContext getServletContext() {
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }
 
  @Override
  public DispatcherType getDispatcherType() {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }
 
  @Override
  public String getRealPath(String path) {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }

  @Override
  public String getPathInfo() {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  //======================= authentication =======================
 
  @Override
  public String getRemoteUser() {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }

  @Override
  public boolean isUserInRole(String role) {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }

  @Override
  public Principal getUserPrincipal() {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  }

  @Override
  public String getAuthType() {
    // TODO need implement
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

TOP

Related Classes of com.firefly.server.exception.HttpServerException

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.