Search in sources :

Example 1 with DeleteMapping

use of org.springframework.web.bind.annotation.DeleteMapping in project av-service by dvoraka.

the class FileController method deleteFile.

@DeleteMapping("/{filename}")
public ResponseEntity<Void> deleteFile(@PathVariable String filename, Principal principal) {
    log.debug("Delete file: {}, principal: {}", filename, principal);
    AvMessage fileRequest = new DefaultAvMessage.Builder(Utils.genUuidString()).filename(filename).owner(principal.getName()).type(MessageType.FILE_DELETE).build();
    restService.deleteFile(fileRequest);
    return new ResponseEntity<>(HttpStatus.OK);
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) AvMessage(dvoraka.avservice.common.data.AvMessage) DefaultAvMessage(dvoraka.avservice.common.data.DefaultAvMessage) DeleteMapping(org.springframework.web.bind.annotation.DeleteMapping)

Aggregations

AvMessage (dvoraka.avservice.common.data.AvMessage)1 DefaultAvMessage (dvoraka.avservice.common.data.DefaultAvMessage)1 ResponseEntity (org.springframework.http.ResponseEntity)1 DeleteMapping (org.springframework.web.bind.annotation.DeleteMapping)1