Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public class SupabaseStorage
- Object
- SupabaseStorage
Supabase Storage: upload, download and remove objects in buckets, and
build public URLs for public buckets.
Methods
Inherited methods
Method details
upload
public AsyncResource<Map<String, Object>> upload(String bucket, String path, byte[] data, String contentType, boolean upsert)Uploads an object.
Parameters
bucketString- the bucket
pathString- the object path inside the bucket,
folder/file.png databyte[]- the content
contentTypeString- the MIME type
upsertboolean- true to replace an existing object
Returns
the response, holding the object
Keydownload
public AsyncResource<byte[]> download(String bucket, String path)Downloads an object with the current user’s credentials.
Parameters
bucketString- the bucket
pathString- the object path
Returns
the bytes
remove
public AsyncResource<Boolean> remove(String bucket, String... paths)Removes objects from a bucket.
Parameters
bucketString- the bucket
pathsString...- the object paths
Returns
completes with true when the request succeeds
getPublicUrl
public String getPublicUrl(String bucket, String path)The URL of an object in a public bucket. It makes no request.
Parameters
bucketString- the bucket
pathString- the object path
Returns
the URL