Package org.sonatype.nexus.web

Examples of org.sonatype.nexus.web.ErrorStatusException


    Throwable cause = (Throwable) request.getAttribute(ERROR_EXCEPTION);
    String errorName = null;

    // Handle customization of error from exception details
    if (cause instanceof ErrorStatusException) {
      ErrorStatusException e = (ErrorStatusException) cause;
      errorCode = e.getResponseCode();
      errorName = e.getReasonPhrase();
      errorMessage = messageOf(e);
    }

    // this happens if someone browses directly to the error page
    if (errorCode == null) {
View Full Code Here


  {
    final ViewNameParser viewNameParser = new ViewNameParser(req.getPathInfo());

    final View view = viewRegistry.getView(viewNameParser.getViewName());
    if (view == null) {
      throw new ErrorStatusException(HttpServletResponse.SC_NOT_FOUND, "Not Found", "View not found.");
    }

    final ViewRequest request = new HttpViewRequest(req, view.getConfig(), viewNameParser.getRemainingPath(),
        req.getQueryString());
View Full Code Here

      if (logger.isWarnEnabled()) {
        logger.warn("{} {}", exception.getMessage(), requestDetails(request), exception);
      }
    }

    throw new ErrorStatusException(responseCode, null, exception.getMessage());
  }
View Full Code Here

      case "TRACE":
        doTrace(request, response);
        break;

      default:
        throw new ErrorStatusException(SC_METHOD_NOT_ALLOWED, null, "Method not supported: " + method);
    }
  }
View Full Code Here

        if (contentNeeded) {
          webUtils.sendContent(file.getInputStream(), response);
        }
      }
      else if (ranges.size() > 1) {
        throw new ErrorStatusException(SC_NOT_IMPLEMENTED, "Not Implemented",
            "Multiple ranges not yet supported.");
      }
      else {
        final Range<Long> range = ranges.get(0);
        if (!isRequestedRangeSatisfiable(file, range)) {
View Full Code Here

TOP

Related Classes of org.sonatype.nexus.web.ErrorStatusException

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.