VirtualFileOperations class

Inheritance

Constructors

VirtualFileOperations.new(List<String> allowedDirectories, {String startingDirectory = '/'})
Constructs a VirtualFileOperations object for managing directories.

Properties

currentDirectory String
getter/setter pairinherited
directoryMappings Map<String, String>
final
hashCode int
The hash code for this object.
no setterinherited
rootDirectory String
getter/setter pairinherited
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.
override
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.
override
copy() VirtualFileOperations
override
createDirectory(String path) Future<void>
Creates a directory at the specified path.
override
deleteDirectory(String path) Future<void>
Deletes the directory at the specified path.
override
deleteFile(String path) Future<void>
Deletes the file at the specified path.
override
exists(String path) bool
Checks if a file or directory exists at the specified path.
override
fileSize(String path) Future<int>
Returns the size of the file at the specified path.
override
getCurrentDirectory() String
Returns the current working directory.
inherited
getFile(String path) Future<File>
Retrieves a File object for the given path.
override
listDirectory(String path) Future<List<FileSystemEntity>>
Lists the contents of the directory at the given path.
override
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.
override
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.
override
resolvePath(String path) String
Resolves the given path relative to the currentDirectory and the specific file system rules (physical or virtual).
override
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.
override

Operators

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