BlobStore provides abstract and concrete interfaces for the upload, download, and caching of arbitrary and named raw data with a remote file server.
- synchronous and asynchronous API
- local caching, with automatic cache management
- preservation of original filename and MIME type
See BlobStore.swift protocol for overview.
- LocalBlobStore: deals in local disk-backed files.
- RemoteBlobStore: deals in remote network-backed resources.
- RemoteCachingBlobStore: deals in network-backed resources that are also cached locally upon download. (A subclass of RemoteBlobStore, employing LocalBlobStore.)
- SmartBlobStore: deals in network-backed resources that are cached locally on both download and upload, thus facilitating bidirectional offline operation. (Employs RemoteCachingBlobStore and LocalBlobStore.)
The API for blob retrieval provides both Data
and local file URL
-based methods. Depending on the use case one might be more suitable. Also, depending on the concrete implementation, behaviour might be different—for example, RemoteBlobstore will always return a nil URL
since it creates no persistent resource.