FilesystemAdapter class
Base filesystem adapter providing common functionality using the file package.
- Implemented types
Constructors
- FilesystemAdapter(DiskConfig config, {FileSystem? fileSystem})
-
FilesystemAdapter.fromMap(Map<
String, dynamic> configMap, {FileSystem? fileSystem}) -
Create from a map configuration (legacy support)
factory
Properties
- config → DiskConfig
-
The filesystem configuration.
final
- fileSystem → FileSystem
-
The filesystem instance from the file package
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String?
-
Get the disk name.
no setter
- root → String
-
Get the root path
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
-
assertCount(
String path, int count, {bool recursive = false}) → Future< FilesystemAdapter> - Assert that the number of files in path equals the expected count.
-
assertDirectoryEmpty(
String path) → Future< FilesystemAdapter> - Assert that the given directory is empty.
-
assertExists(
dynamic path, {String? content}) → Future< FilesystemAdapter> - Assert that the given file or directory exists.
-
assertMissing(
dynamic path) → Future< FilesystemAdapter> - Assert that the given file or directory does not exist.
-
checksum(
String path, {String algorithm = 'md5'}) → Future< String?> -
Get the checksum for a file.
override
-
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
-
directoryExists(
String path) → Future< bool> - Determine if a directory exists.
-
directoryMissing(
String path) → Future< bool> - Determine if a directory is missing.
-
diskName(
String name) → FilesystemAdapter - Set the disk name.
-
exists(
String path) → Future< bool> -
Determine if a file exists.
override
-
fileExists(
String path) → Future< bool> - Determine if a file exists.
-
fileMissing(
String path) → Future< bool> - Determine if a file is missing.
-
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
-
getConfig(
) → DiskConfig - Get the configuration.
-
getVisibility(
String path) → Future< String> -
Get the visibility for the given path.
override
-
json(
String path) → Future< Map< String, dynamic> ?> - Get the contents of a file as decoded JSON.
-
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?> -
Get the mime-type of a 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
-
path(
String path) → String - Get the full path to the file.
-
prepend(
String path, String data, {String separator = '\n'}) → Future< bool> -
Prepend to a file.
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
-
toString(
) → String -
A string representation of this object.
inherited
-
url(
String path) → String - Get the URL for the file at the given path.
-
writeStream(
String path, Stream< List< resource, {Map<int> >String, dynamic> ? options}) → Future<bool> -
Write a new file using a stream.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited