FileOperations class abstract

Interface defining common file operations for both physical and virtual file systems.

Implementers

Constructors

FileOperations.new(String rootDirectory)

Properties

currentDirectory String
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
rootDirectory String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

changeDirectory(String path) → void
Changes the current working directory to the specified path. Implementations must handle path resolution and update the internal state correctly.
changeToParentDirectory() → void
Changes the current working directory to the parent directory. Implementations must handle path resolution and update the internal state correctly, including checks for navigating above the root.
copy() FileOperations
createDirectory(String path) Future<void>
Creates a directory at the specified path.
deleteDirectory(String path) Future<void>
Deletes the directory at the specified path.
deleteFile(String path) Future<void>
Deletes the file at the specified path.
exists(String path) bool
Checks if a file or directory exists at the specified path.
fileSize(String path) Future<int>
Returns the size of the file at the specified path.
getCurrentDirectory() String
Returns the current working directory.
getFile(String path) Future<File>
Retrieves a File object for the given path.
listDirectory(String path) Future<List<FileSystemEntity>>
Lists the contents of the directory at the given path.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readFile(String path) Future<List<int>>
Reads and returns the data from the file at the specified path.
renameFileOrDirectory(String oldPath, String newPath) Future<void>
Renames a file or directory from the old path to the new path. Both paths are relative to the current working directory. Implementations must handle path resolution and ensure the operation stays within allowed boundaries.
resolvePath(String path) String
Resolves the given path relative to the currentDirectory and the specific file system rules (physical or virtual).
toString() String
A string representation of this object.
inherited
writeFile(String path, List<int> data) Future<void>
Writes data to a file at the specified path.

Operators

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