FileOperations class abstract
Interface defining common file operations for both physical and virtual file systems.
- Implementers
Constructors
- FileOperations(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.
-
changeToParentDirectory(
) → void - Changes the current working directory to the parent directory.
-
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.
-
resolvePath(
String path) → String -
Resolves the given
path
relative to the currentDirectory. The resolved path is normalized and checked to ensure it stays within the rootDirectory. -
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