Package org.springframework.data.rest.webmvc

Examples of org.springframework.data.rest.webmvc.ResourceNotFoundException


  }

  private void verifyAlpsEnabled() {

    if (!configuration.metadataConfiguration().alpsEnabled()) {
      throw new ResourceNotFoundException();
    }
  }
View Full Code Here


      HttpMessageConverter<Object> converter, Serializable id) {

    if (request.isPatchRequest() && converter instanceof MappingJackson2HttpMessageConverter) {

      if (id == null) {
        new ResourceNotFoundException();
      }

      RepositoryInvoker invoker = information.getInvoker();
      Object existingObject = invoker.invokeFindOne(id);

      if (existingObject == null) {
        throw new ResourceNotFoundException();
      }

      ObjectMapper mapper = ((MappingJackson2HttpMessageConverter) converter).getObjectMapper();
      Object result = readPatch(request, mapper, existingObject);
View Full Code Here

        RepositoryInvoker invoker = repoRequest.getInvoker();

        Object domainObj = invoker.invokeFindOne(id);

        if (null == domainObj) {
            throw new ResourceNotFoundException();
        }

        PersistentProperty<?> prop = persistentEntity.getPersistentProperty(property);
        if (null == prop) {
            throw new ResourceNotFoundException();
        }

        if (isOfFileType(prop)) {
            fileResourceLoader().downloadFile(domainObj, prop, (HttpServletResponse) response);
        }
View Full Code Here

        RepositoryInvoker invoker = repoRequest.getInvoker();

        Object domainObj = invoker.invokeFindOne(id);

        if (null == domainObj) {
            throw new ResourceNotFoundException();
        }

        PersistentProperty<?> prop = persistentEntity.getPersistentProperty(property);
        if (null == prop) {
            throw new ResourceNotFoundException();
        }

        if (isOfFileType(prop)) {
            return toResponseEntity(OK, new HttpHeaders(), new Resource<FilePropertyValue>(evaluateFilePropertyValue(domainObj, prop)));
        }
View Full Code Here

        RepositoryInvoker invoker = repoRequest.getInvoker();

        Object domainObj = invoker.invokeFindOne(id);

        if (null == domainObj) {
            throw new ResourceNotFoundException();
        }

        PersistentProperty<?> prop = persistentEntity.getPersistentProperty(property);
        if (null == prop) {
            throw new ResourceNotFoundException();
        }

        if (!isOfFileType(prop)) {
            return toEmptyResponse(METHOD_NOT_ALLOWED);
        }
View Full Code Here

            byte[] fileData = fileResourceStorage.load(instance, persistentProperty);

            return new FilePropertyValue(fileLink, fileData);

        } catch (Exception e) {
            throw new ResourceNotFoundException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.webmvc.ResourceNotFoundException

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.