use of bio.terra.app.controller.exception.ValidationException in project jade-data-repo by DataBiosphere.
the class RepositoryApiController method lookupFileByPath.
@Override
public ResponseEntity<FileModel> lookupFileByPath(@PathVariable("id") String id, @RequestParam(value = "path", required = true) String path, @RequestParam(value = "depth", required = false, defaultValue = "0") Integer depth) {
iamService.verifyAuthorization(getAuthenticatedInfo(), IamResourceType.DATASET, id, IamAction.READ_DATA);
if (!ValidationUtils.isValidPath(path)) {
throw new ValidationException("InvalidPath");
}
FileModel fileModel = fileService.lookupPath(id, path, depth);
return new ResponseEntity<>(fileModel, HttpStatus.OK);
}
Aggregations