Package com.firefly.server.exception

Examples of com.firefly.server.exception.HttpServerException


  }

  @Override
  public ServletOutputStream getOutputStream() throws IOException {
    if (usingWriter)
      throw new HttpServerException(
          "getWriter has already been called for this response");
    if (usingFileOutputStream)
      throw new HttpServerException(
          "getStaticFileOutputStream has already been called for this response");

    createOutput();

    usingOutputStream = true;
View Full Code Here


  }

  @Override
  public PrintWriter getWriter() throws IOException {
    if (usingOutputStream)
      throw new HttpServerException(
          "getOutputStream has already been called for this response");
    if (usingFileOutputStream)
      throw new HttpServerException(
          "getStaticFileOutputStream has already been called for this response");

    createOutput();

    usingWriter = true;
View Full Code Here

  }

  @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

          }
          log.debug("single range download|{}", range);
        }
      }
    } catch (Throwable e) {
      throw new HttpServerException("get static file output stream error");
    } finally {
      if (out != null)
        try {
          // System.out.println("close~~");
          out.close();
        } catch (IOException e) {
          throw new HttpServerException(
              "static file output stream close error");
        }
    }
  }
View Full Code Here

  public HttpHandler(HttpServletDispatcherController servletController,
      Config config) {
    httpConnectionListener = config.getHttpConnectionListener();
    String appPrefix = config.getContextPath() + config.getServletPath();
    if (VerifyUtils.isEmpty(appPrefix))
      throw new HttpServerException(
          "context path and servlet path can not be null");

    if (config.getHandlerSize() > 0) {
      requestHandler = new QueueRequestHandler(appPrefix,
          servletController, new FileDispatcherController(config),
View Full Code Here

    return lastAccessedTime;
  }

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

    return maxInactiveInterval;
  }

  @Override
  public HttpSessionContext getSessionContext() {
    throw new HttpServerException("no implements this method!");
  }
View Full Code Here

  //======================= socket output stream =======================
 
  public StaticFileOutputStream getStaticFileOutputStream()
      throws IOException {
    if (usingWriter)
      throw new HttpServerException(
          "getWriter has already been called for this response");
    if (usingOutputStream)
      throw new HttpServerException(
          "getOutputStream has already been called for this response");

    createOutput();
    usingFileOutputStream = true;
    return fileOut;
View Full Code Here

  }

  @Override
  public ServletOutputStream getOutputStream() throws IOException {
    if (usingWriter)
      throw new HttpServerException(
          "getWriter has already been called for this response");
    if (usingFileOutputStream)
      throw new HttpServerException(
          "getStaticFileOutputStream has already been called for this response");

    createOutput();

    usingOutputStream = true;
View Full Code Here

  }

  @Override
  public PrintWriter getWriter() throws IOException {
    if (usingOutputStream)
      throw new HttpServerException(
          "getOutputStream has already been called for this response");
    if (usingFileOutputStream)
      throw new HttpServerException(
          "getStaticFileOutputStream has already been called for this response");

    createOutput();

    usingWriter = true;
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.