Package org.deftserver.web.http

Examples of org.deftserver.web.http.HttpException


  }

  private static class ThrowingHttpExceptionRequestHandler extends RequestHandler {
    @Override
    public void get(org.deftserver.web.http.HttpRequest request, org.deftserver.web.http.HttpResponse response) {
      throw new HttpException(500, "exception message");
    }
View Full Code Here


  private static class AsyncThrowingHttpExceptionRequestHandler extends RequestHandler {
    @Asynchronous
    @Override
    public void get(org.deftserver.web.http.HttpRequest request, org.deftserver.web.http.HttpResponse response) {
      throw new HttpException(500, "exception message");
    }
View Full Code Here

  private void perform(final HttpRequest request, final HttpResponse response, boolean hasBody) {
   
    final String path = request.getRequestedPath();
    final File file = new File(path.substring(1))// remove the leading '/'
    if (!file.exists()) {
      throw new HttpException(404);
    } else if (!file.isFile()) {
      throw new HttpException(403, path + "is not a file");
    }

    final long lastModified = file.lastModified();
    response.setHeader("Last-Modified", String.valueOf(lastModified));
    response.setHeader("Cache-Control", "public");
View Full Code Here

  }

  private static class ThrowingHttpExceptionRequestHandler extends RequestHandler {
    @Override
    public void get(org.deftserver.web.http.HttpRequest request, org.deftserver.web.http.HttpResponse response) {
      throw new HttpException(500, "exception message");
    }
View Full Code Here

  private static class AsyncThrowingHttpExceptionRequestHandler extends RequestHandler {
    @Asynchronous
    @Override
    public void get(org.deftserver.web.http.HttpRequest request, org.deftserver.web.http.HttpResponse response) {
      throw new HttpException(500, "exception message");
    }
View Full Code Here

TOP

Related Classes of org.deftserver.web.http.HttpException

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.