CloudAdapter class

Cloud storage adapter that implements the Cloud contract.

Provides filesystem operations for S3-compatible storage with support for temporary URLs, ACLs, and other cloud-specific features.

Implemented types

Constructors

CloudAdapter({required CloudFileSystem fileSystem, required DiskConfig config, Uri? baseUrl})
Creates a new cloud storage adapter.
CloudAdapter.fromConfig(DiskConfig config)
Create a CloudAdapter from configuration
factory

Properties

config → DiskConfig
The filesystem configuration
final
driver → CloudStorageDriver
Gets the underlying cloud storage driver.
no setter
fileSystem → CloudFileSystem
The cloud filesystem backend
final
hashCode → int
The hash code for this object.
no setterinherited
name → String?
Get the disk name
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

allDirectories([String? directory]) → Future<List<String>>
Get all the directories within a given directory (recursive).
override
allFiles([String? directory]) → Future<List<String>>
Get all of the files from the given directory (recursive).
override
append(String path, String data, {String separator = '\n'}) → Future<bool>
Append to a file.
override
buildTemporaryUploadUrlsUsing(FutureOr<Map<String, dynamic>> callback(String path, DateTime expiration, Map<String, dynamic> options)) → void
Override temporary upload URL generation for testing.
buildTemporaryUrlsUsing(FutureOr<String> callback(String path, DateTime expiration, Map<String, dynamic> options)) → void
Override temporary URL generation for testing.
checksum(String path, {String algorithm = 'md5'}) → Future<String?>
Get the checksum for the given file.
override
clearTemporaryUrlCallbacks() → void
Reset custom temporary URL callbacks.
copy(String from, String to) → Future<bool>
Copy a file to a new location.
override
delete(dynamic paths) → Future<bool>
Delete the file at a given path.
override
deleteDirectory(String directory) → Future<bool>
Recursively delete a directory.
override
directories([String? directory, bool recursive = false]) → Future<List<String>>
Get all of the directories within a given directory.
override
diskName(String name) → CloudAdapter
Set the disk name
exists(String path) → Future<bool>
Determine if a file exists.
override
files([String? directory, bool recursive = false]) → Future<List<String>>
Get an array of all files in a directory.
override
get(String path) → Future<String?>
Get the contents of a file.
override
getTemporaryUploadUrl(String path, DateTime expiration, {Map<String, dynamic>? options}) → Future<Map<String, dynamic>>
Get a temporary upload URL for the file at the given path (async version).
getTemporaryUrl(String path, DateTime expiration, {Map<String, dynamic>? options}) → Future<String>
Get a temporary download URL for the file at the given path (async version).
getVisibility(String path) → Future<String>
Get the visibility for the given path.
override
lastModified(String path) → Future<DateTime>
Get the file's last modification time.
override
makeDirectory(String path) → Future<bool>
Create a directory.
override
mimeType(String path) → Future<String?>
Determine the mime type for the given file.
override
missing(String path) → Future<bool>
Determine if a file or directory is missing.
override
move(String from, String to) → Future<bool>
Move a file to a new location.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepend(String path, String data, {String separator = '\n'}) → Future<bool>
Prepend to a file.
override
providesTemporaryUrls() → bool
Determine if temporary URLs can be generated.
override
put(String path, dynamic contents, {Map<String, dynamic>? options}) → Future<bool>
Write the contents of a file.
override
readStream(String path) → Stream<List<int>>?
Get the contents of a file as a stream.
override
setVisibility(String path, String visibility) → Future<bool>
Set the visibility for the given path.
override
size(String path) → Future<int>
Get the file size of a given file.
override
temporaryUrl(String path, DateTime expiration, {Map<String, dynamic>? options}) → String
Get a temporary URL for the file at the given path.
override
toString() → String
A string representation of this object.
inherited
url(String path) → String
Get the URL for the file at the given path.
override
writeStream(String path, Stream<List<int>> resource, {Map<String, dynamic>? options}) → Future<bool>
Write a new file using a stream.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited