Package javax.ws.rs

Examples of javax.ws.rs.NotFoundException


    try {
      final Certificate certificate = trustStore.getTrustedCertificate(id);
      return asCertificateXO(certificate, true);
    }
    catch (KeyNotFoundException e) {
      throw new NotFoundException(format("Certificate with fingerprint '%s' not found", id));
    }
  }
View Full Code Here


  {
    try {
      trustStore.removeTrustCertificate(id);
    }
    catch (KeyNotFoundException e) {
      throw new NotFoundException(format("Certificate with fingerprint '%s' not found", id));
    }
  }
View Full Code Here

  }

  private CapabilityManager getManager(final String type) {
    final CapabilityManager manager = managers.get(type);
    if (manager == null) {
      throw new NotFoundException("Capability manager of type '" + type + "' are not supported");
    }
    return manager;
  }
View Full Code Here

  public SyndFeed get(@PathParam(FEED_KEY) String feedKey, @DefaultValue("0") @QueryParam("from") int from,
                      @DefaultValue("40") @QueryParam("count") int count, final @Context UriInfo uriInfo)
  {
    final FeedSource feedSource = feeds.get(feedKey);
    if (feedSource == null) {
      throw new NotFoundException("Feed " + feedKey + " not found!");
    }

    try {
      final Map<String, String> params = getParameters(uriInfo);
      final List<FeedEvent> feedEvents = feedSource.getFeed(from, count, params);
View Full Code Here

    if (count == null) {
      count = Long.MAX_VALUE;
    }
    InputStream log = logManager.getApplicationLogAsStream("nexus.log", from, count);
    if (log == null) {
      throw new NotFoundException("nexus.log not found");
    }
    return Response.ok(log)
        .header("Content-Disposition", "attachment; filename=\"nexus.log\"")
        .build();
  }
View Full Code Here

    }

    private Person findSafely(long personId) {
        final Optional<Person> person = peopleDAO.findById(personId);
        if (!person.isPresent()) {
            throw new NotFoundException("No such user.");
        }
        return person.get();
    }
View Full Code Here

                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream)
                               throws IOException, WebApplicationException {
        if (!entity.isPresent())
            throw new NotFoundException();

        ParameterizedType actualGenericType = (ParameterizedType) genericType;

        MessageBodyWriter writer = mbw.get().getMessageBodyWriter(entity.get().getClass(),
                actualGenericType.getActualTypeArguments()[0], annotations, mediaType);
View Full Code Here

        this.id = id;
        this.itemsModel = itemsModel;
        try {
            itemModel = itemsModel.getItem(id);
        } catch (IndexOutOfBoundsException ex) {
            throw new NotFoundException();
        }
    }
View Full Code Here

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

    @Path("items/{itemid}/")
    public Item getItem(@PathParam("itemid") String itemid) {
        Item i = getItems().get(itemid);
        if (i == null) {
            throw new NotFoundException(Response
                    .status(Response.Status.NOT_FOUND)
                    .entity("Item, " + itemid + ", is not found")
                    .build());
        }
View Full Code Here

TOP

Related Classes of javax.ws.rs.NotFoundException

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.