Examples of NotAllowedException


Examples of com.gitblit.GitBlitException.NotAllowedException

      } else if (e.getMessage().indexOf("403") > -1) {
        // requested url is forbidden by the requesting user
        throw new ForbiddenException(url);
      } else if (e.getMessage().indexOf("405") > -1) {
        // requested url is not allowed by the server
        throw new NotAllowedException(url);
      } else if (e.getMessage().indexOf("501") > -1) {
        // requested url is not recognized by the server
        throw new UnknownRequestException(url);
      }
      throw e;
View Full Code Here

Examples of com.gitblit.GitBlitException.NotAllowedException

      } else if (e.getMessage().indexOf("403") > -1) {
        // requested url is forbidden by the requesting user
        throw new ForbiddenException(url);
      } else if (e.getMessage().indexOf("405") > -1) {
        // requested url is not allowed by the server
        throw new NotAllowedException(url);
      } else if (e.getMessage().indexOf("501") > -1) {
        // requested url is not recognized by the server
        throw new UnknownRequestException(url);
      }
      throw e;
View Full Code Here

Examples of freenet.clients.fcp.NotAllowedException

  private File getDownloadsDir (String downloadPath) throws NotAllowedException {
    File downloadsDir = new File(downloadPath);
    //Invalid if it's disallowed, doesn't exist, isn't a directory, or can't be created.
    if(!core.allowDownloadTo(downloadsDir) || !((downloadsDir.exists() &&
        downloadsDir.isDirectory()) || !downloadsDir.mkdirs())) {
      throw new NotAllowedException();
    }
    return downloadsDir;
  }
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

    private List<Router> getMethodRouter(final RequestProcessingContext context) {
        final ContainerRequest request = context.request();
        final List<ConsumesProducesAcceptor> acceptors = consumesProducesAcceptors.get(request.getMethod());
        if (acceptors == null) {
            throw new NotAllowedException(
                    Response.status(Status.METHOD_NOT_ALLOWED).allow(consumesProducesAcceptors.keySet()).build());
        }

        final List<ConsumesProducesAcceptor> satisfyingAcceptors = new LinkedList<>();
        final Set<ResourceMethod> differentInvokableMethods = Sets.newIdentityHashSet();
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

                    break;
                case NOT_FOUND:
                    webAppException = new NotFoundException(response);
                    break;
                case METHOD_NOT_ALLOWED:
                    webAppException = new NotAllowedException(response);
                    break;
                case NOT_ACCEPTABLE:
                    webAppException = new NotAcceptableException(response);
                    break;
                case UNSUPPORTED_MEDIA_TYPE:
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

    private List<Router> getMethodRouter(final RequestProcessingContext context) {
        final ContainerRequest request = context.request();
        final List<ConsumesProducesAcceptor> acceptors = consumesProducesAcceptors.get(request.getMethod());
        if (acceptors == null) {
            throw new NotAllowedException(
                    Response.status(Status.METHOD_NOT_ALLOWED).allow(consumesProducesAcceptors.keySet()).build());
        }

        final List<ConsumesProducesAcceptor> satisfyingAcceptors = new LinkedList<>();
        final Set<ResourceMethod> differentInvokableMethods = Sets.newIdentityHashSet();
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

         case 401:
            throw new NotAuthorizedException(response);
         case 404:
            throw new NotFoundException(response);
         case 405:
            throw new NotAllowedException(response);
         case 406:
            throw new NotAcceptableException(response);
         case 415:
            throw new NotSupportedException(response);
         case 500:
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

               throw new DefaultOptionsMethodException("No resource method found for options, return OK with Allow header", res);
            }
            else
            {
               Response res = Response.status(HttpResponseCodes.SC_METHOD_NOT_ALLOWED).header(HttpHeaderNames.ALLOW, allowHeaderValue).build();
               throw new NotAllowedException("No resource method found for " + httpMethod + ", return 405 with Allow header", res);
            }
         }
         else if (!consumeMatch)
         {
            throw new NotSupportedException("Cannot consume content type");
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

  @Test
  public void testNotAllowedJaxRsException() throws Exception {
    // prepare
    String message = "The request dispatcher does not allow the HTTP method used for the request.";
    Exception exception =
        new NotAllowedException(Response.status(Response.Status.METHOD_NOT_ALLOWED).header(HttpHeaders.ALLOW, "GET")
            .build());

    // execute
    Response response = exceptionMapper.toResponse(exception);
View Full Code Here

Examples of javax.ws.rs.NotAllowedException

                    break;
                case NOT_FOUND:
                    webAppException = new NotFoundException(response);
                    break;
                case METHOD_NOT_ALLOWED:
                    webAppException = new NotAllowedException(response);
                    break;
                case NOT_ACCEPTABLE:
                    webAppException = new NotAcceptableException(response);
                    break;
                case UNSUPPORTED_MEDIA_TYPE:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.