Package com.sun.jersey.api

Examples of com.sun.jersey.api.NotFoundException


    }
   
    @Path("tracks/{num}/")
    public Track getTrack(@PathParam("num") int num) {
        if (num >= tracks.length)
            throw new NotFoundException("Track, " + num + ", of CD, " + getTitle() + ", is not found");
        return tracks[num];
    }   
View Full Code Here


            RestKey key = new RestKey(version, endpoint);
       
            Provider<RestResource> provider = restResources.get(key);
           
            if (provider == null) {
                throw new NotFoundException(String.format("No rest resource found for '%s:%s'", version, endpoint ));
            }     
           
            return provider.get();
        }
        throw new NotFoundException(String.format("No rest resource for explorer", getName(), endpoint));
    }
View Full Code Here

            throws Exception {
        Provider<ViewableResource> provider = controllers.get(controllerName);
        if (provider != null) {
            return provider.get();
        }
        return new NotFoundException(String.format(
                "Controller for '%s' not found", controllerName));
    }
View Full Code Here

                } catch (IOException e) {
                    throw new WebApplicationException(404);
                }
       
    if (buffer == null)
      throw new NotFoundException();
    else  {
      if (CACHE_ENABLED.get()) {
        CacheControl cc = new CacheControl();
        cc.setMaxAge(MAX_AGE.get());
        cc.setNoCache(false);
View Full Code Here

          .createNamedQuery(
              resourceType + ".findByPrimaryKeyForRecord")
          .setParameter("healthRecordId", healthRecordId)
          .setParameter(resourceKey, resourceId).getSingleResult();
    } catch (NoResultException ex) {
      throw new NotFoundException(resourceType + ", " + resourceId
          + ", not found");
    } finally {
      persistenceSvc.close();
    }
  }
View Full Code Here

      } catch (InstantiationException ex2) {
        logger.error("Error creating new care resource: ", ex2);
      } catch (IllegalAccessException ex3) {
        logger.error("Error creating new care resource: ", ex3);
      }
      throw new NotFoundException(resourceType + " not found");
    } finally {
      persistenceSvc.commitTx();
      persistenceSvc.close();
    }
  }
View Full Code Here

      } catch (InstantiationException ex2) {
        logger.error("Error creating new care resource: ", ex2);
      } catch (IllegalAccessException ex3) {
        logger.error("Error creating new care resource: ", ex3);
      }
      throw new NotFoundException(resourceType + " not found");
    } finally {
      persistenceSvc.commitTx();
      persistenceSvc.close();
    }
  }
View Full Code Here

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

        return FileStore.FS.exists(p);
    }
   
    static void checkExistence(String path) {
        if (!FileStore.FS.exists(path))
            throw new NotFoundException("Entry does not exist");
    }   
View Full Code Here

        if (!resourceConfig.getFeature(ResourceConfig.FEATURE_MATCH_MATRIX_PARAMS)) {
            path = stripMatrixParams(path);
        }

        if (!rootsRule.accept(path, null, localContext)) {
            throw new NotFoundException(request.getRequestUri());
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.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.