Class ObjectStorages
java.lang.Object
com.codename1.backend.storage.ObjectStorages
The server's ObjectStorage, opened from cn1.storage.url the first time it
is asked for.
| URL | provider |
|---|---|
memory: |
in this process, for tests; the default when nothing is set |
s3://us-east-1 |
Amazon S3 in that region (s3:// alone reads AWS_REGION) |
s3://us-east-1 with cn1.storage.s3.endpoint |
an S3-compatible service: MinIO, Ceph, B2, Wasabi |
r2://<account id> |
Cloudflare R2 |
gs:// or gs://<project> |
Google Cloud Storage |
azblob://<account> |
Azure Blob Storage |
Each provider is a separate class the build compiles in only when the
configuration names it, the way messaging transports are: the generated
wiring calls register(String, ObjectStorages.Factory) for that one. A test or a hand-wired server
registers the factory itself.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceOpens a provider from its URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe part ofurlafterscheme://, up to any slash; empty when there is none.static ObjectStoragecurrent()The calling thread's server's storage, opened on first use.static booleanisConfigured(Config config) Whether the configuration names a real provider rather than the in-memory store.static ObjectStorageThe storage the configuration names; the in-memory store when it names none.static ObjectStorageThe storageurlnames, configured fromconfig(which may be null).static voidregister(String scheme, ObjectStorages.Factory factory) Makesscheme(s3,r2,gs,azblob) open throughfactory.static StringA configuration value, else the environment variableenv(which may be null), else null.static Stringcn1.storage.url, trimmed, or null when it is not set.
-
Method Details
-
register
Makesscheme(s3,r2,gs,azblob) open throughfactory. -
current
The calling thread's server's storage, opened on first use.- Throws:
IOException
-
url
cn1.storage.url, trimmed, or null when it is not set.- Throws:
IOException
-
isConfigured
Whether the configuration names a real provider rather than the in-memory store.- Throws:
IOException
-
open
The storage the configuration names; the in-memory store when it names none.- Throws:
IOException
-
open
The storageurlnames, configured fromconfig(which may be null).- Throws:
IOException
-
setting
A configuration value, else the environment variableenv(which may be null), else null. Shared by the providers' factories.- Throws:
IOException
-
authority
-