Package io.supabase.api
Interface IStorageFileAPI
- All Known Implementing Classes:
StorageFileAPI
public interface IStorageFileAPI
-
Method Summary
Modifier and TypeMethodDescriptionPOST /object/copy/DELETE /object/{bucketName}download(String path, FileTransformOptions transformOptions) Downloads a file from a private bucket.getPublicUrl(String path, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) Creates the url for an object in a public bucketgetSignedUrl(String path, int expiresIn, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) POST /object/sign/{bucketName}getSignedUrls(List<String> paths, int expiresIn, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) POST /object/sign/{bucketName}list(FileSearchOptions options) POST /object/list/{bucketName}list(String path, FileSearchOptions options) POST /object/list/{bucketName}POST /object/move/PUT /object/{bucketName}/{wildcard}POST /object/{bucketName}/{wildcard}
-
Method Details
-
upload
POST /object/{bucketName}/{wildcard}
- Parameters:
path- The path to the file within the bucket of where it should be uploaded.file- The file that needs to be uploaded.- Returns:
- a
FilePathResponse
-
update
PUT /object/{bucketName}/{wildcard}
- Parameters:
path- The path to the file within the bucket that should get updated.file- The new file that should be placed.- Returns:
- a
FilePathResponse
-
move
POST /object/move/
- Parameters:
fromPath- The path to the object that needs to be moved.toPath- The new path where the object should be moved to.- Returns:
- a
MessageResponse
-
copy
POST /object/copy/
- Parameters:
fromPath- The path to the object that needs to be copied.toPath- The new path where the object should be copied to.- Returns:
- a
FilePathResponse
-
getSignedUrl
CompletableFuture<FileSignedUrlResponse> getSignedUrl(String path, int expiresIn, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) POST /object/sign/{bucketName}
This method just wraps
getSignedUrls(List, int, FileDownloadOption, FileTransformOptions)- Parameters:
path- The singular file path that should be signed.expiresIn- how many seconds until the signed url expires.downloadOptions- any additional download options.transformOptions- The transform options if any- Returns:
- a
FileSignedUrlResponse
-
getSignedUrls
CompletableFuture<List<FileSignedUrlResponse>> getSignedUrls(List<String> paths, int expiresIn, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) POST /object/sign/{bucketName}
- Parameters:
paths- a list of file paths that should be signed.expiresIn- how many seconds until the signed urls expires.downloadOptions- any additional download options.transformOptions- The transform options if any- Returns:
- a list of
FileSignedUrlResponse
-
download
Downloads a file from a private bucket. To download something from a public bucket, make a request to the url from
getPublicUrl(String, FileDownloadOption, FileTransformOptions)GET /object/authenticated/{bucketName}/{wildcard}
- Parameters:
path- The path of the file to downloadtransformOptions- The transform options if any- Returns:
- a
FileDownload
-
getPublicUrl
FilePublicUrlResponse getPublicUrl(String path, FileDownloadOption downloadOptions, FileTransformOptions transformOptions) Creates the url for an object in a public bucket- Parameters:
path- The path of the file the link should point to.downloadOptions- The download options if any.transformOptions- The transform options if any- Returns:
- a
FilePublicUrlResponse
-
list
POST /object/list/{bucketName}
- Parameters:
options- Options for the file search- Returns:
- a list of
File
-
list
POST /object/list/{bucketName}
- Parameters:
path- The prefix to list objects byoptions- Options for the file search- Returns:
- a list of
File
-
delete
DELETE /object/{bucketName}
- Parameters:
paths- a list of paths to files that should be deleted. BE WARY! PROVIDING NULL OR AN EMPTY LIST WILL DELETE THE ENTIRE BUCKET!- Returns:
- a list of the deleted files
-