use of com.haulmont.restapi.data.FileInfo in project cuba by cuba-platform.
the class FileUploadController method createFileInfoResponseEntity.
protected ResponseEntity<FileInfo> createFileInfoResponseEntity(HttpServletRequest request, FileDescriptor fd) {
FileInfo fileInfo = new FileInfo(fd.getId(), fd.getName(), fd.getSize());
UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(request.getRequestURL().toString()).path("/{id}").buildAndExpand(fd.getId().toString());
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setLocation(uriComponents.toUri());
return new ResponseEntity<>(fileInfo, httpHeaders, HttpStatus.CREATED);
}
Aggregations