Package com.totvs.tjf.storage
Class StorageController
- java.lang.Object
-
- com.totvs.tjf.storage.StorageController
-
@RestController @RequestMapping("/api/v1/storage") public class StorageController extends Object
This class provides signed urls REST endpoints
-
-
Constructor Summary
Constructors Constructor Description StorageController(StorageService storageService)
Constructs the storage controller
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createDeleteSignedUrl(String bucketName, String blobName, String expiresIn)
This endpoint provides signed urls to delete objectsString
createDownloadSignedUrl(String bucketName, String blobName, String expiresIn)
This endpoint provides signed urls to download objectsString
createUploadSignedUrl(String bucketName, String blobName, String mimetype, String expiresIn)
This endpoint provides signed urls to upload objects
-
-
-
Constructor Detail
-
StorageController
public StorageController(StorageService storageService)
Constructs the storage controller- Parameters:
storageService
- the storage service implementation
-
-
Method Detail
-
createDownloadSignedUrl
@GetMapping("createSignedUrl") public String createDownloadSignedUrl(@RequestParam String bucketName, @RequestParam String blobName, @RequestParam String expiresIn) throws IOException, ObjectNotFoundException
This endpoint provides signed urls to download objects- Parameters:
bucketName
- the bucket's nameblobName
- the object's nameexpiresIn
- the object's expiration info- Throws:
IOException
ObjectNotFoundException
-
createDeleteSignedUrl
@DeleteMapping("createSignedUrl") public String createDeleteSignedUrl(@RequestParam String bucketName, @RequestParam String blobName, @RequestParam String expiresIn) throws IOException, ObjectNotFoundException
This endpoint provides signed urls to delete objects- Parameters:
bucketName
- the bucket's nameblobName
- the object's nameexpiresIn
- the object's expiration info- Throws:
IOException
ObjectNotFoundException
-
createUploadSignedUrl
@PutMapping("createSignedUrl") public String createUploadSignedUrl(@RequestParam String bucketName, @RequestParam String blobName, @RequestParam String mimetype, @RequestParam String expiresIn) throws IOException, ObjectNotFoundException
This endpoint provides signed urls to upload objects- Parameters:
bucketName
- the bucket's nameblobName
- the object's namemimetype
- the object's mimetypeexpiresIn
- the object's expiration info- Throws:
IOException
ObjectNotFoundException
-
-