Class FileService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.docshare.documents.rs1.file.FileService
@RestController
@RequestMapping("documents/r1/files")
@Resource(logging=true)
public class FileService
extends PrivateService
Service to manage files.
- Since:
- 14.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> activateFile(String fileUuid) Activates the latest uploaded version of a file.org.springframework.http.ResponseEntity<Void> delete(String fileUuid, @Valid DTOFileDelete dto) Deletes the required file by calling theFileDeleteEvent.org.springframework.http.ResponseEntity<DTOFile> get(String fileUuid, Collection<String> fields) Retrieve the main version of aBOFileby calling theMainVersionFileLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOFile>> getCollection(@Valid Page page, Collection<String> fields, String order, @Valid DTOFileFilter filter) Retrieve the all stored files by calling theFileSearchEvent.org.springframework.http.ResponseEntity<DTOPresignedURL> Retrieve the required presigned URL to download the corresponding file.org.springframework.http.ResponseEntity<DTOPresignedURL> Retrieve the required presigned URL to upload the corresponding file.protected WebResourceloadWebResource(String uuid, Long version) Load the required web resource.org.springframework.http.ResponseEntity<Void> patch(String fileUuid, @Valid DTOFileUpdate dto) Updates the required file by calling theFileUpdateEvent.org.springframework.http.ResponseEntity<DTOFileKey> post(@Valid DTOFileInsert dto) Create a new file by calling theFileInsertEvent.
-
Constructor Details
-
FileService
public FileService()
-
-
Method Details
-
get
@GetMapping(value="{fileUuid:[A-Za-z0-9-]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOFile> get(@PathVariable("fileUuid") String fileUuid, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieve the main version of aBOFileby calling theMainVersionFileLoadEvent. The main version corresponds to the currently active one or the latest one if the active one is not available.- Parameters:
fileUuid- the file idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded file
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadWebResource
protected WebResource loadWebResource(String uuid, Long version) throws DAValidateException, DAException Load the required web resource.- Parameters:
uuid- the uuidversion- the version- Returns:
- the corresponding web resource
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
activateFile
@PostMapping(value="/{fileUuid:[A-Za-z0-9-]+}/activations", produces="application/json") public org.springframework.http.ResponseEntity<Void> activateFile(@PathVariable("fileUuid") String fileUuid) throws DAValidateException, DAException Activates the latest uploaded version of a file. This triggers the file activation process by launching aFileConfirmEvent, which confirms the upload and activates the file, by updating some of its information (such as active flag, byte dimension, etc.).- Parameters:
fileUuid- the file UUID- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception