Classes
Folder
Folder
Represents a Folder (directory) entity on the file system.
Summary
Constructors
Methods
Constructors
constructor
new Folder(): Folder
inherited from constructor
Returns Folder
Properties
isKnown
Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
Methods
clear
Deletes all the files and folders (recursively), contained within this Folder.
Returns Promise<any>
clearSync
Deletes all the files and folders (recursively), contained within this Folder synchronously.
Parameter | Default | Description |
onError |
| (error: any) => void An optional function to be called if some error occurs. |
Returns void
contains
Checks whether this Folder contains an Entity with the specified name.
The path of the folder is added to the name to resolve the complete path to check for.
Parameter | Default | Description |
name |
| string The name of the entity to check for. |
Returns boolean
eachEntity
eachEntity(onEntity: (entity: FileSystemEntity) => boolean): any
Enumerates all the top-level FileSystem entities residing within this folder.
Parameter | Default | Description |
onEntity |
| (entity: FileSystemEntity) => boolean A callback that receives the current entity. If the callback returns false this will mean for the iteration to stop. |
Returns any
getEntities
getEntities(): Promise<FileSystemEntity[]>
Gets all the top-level entities residing within this folder.
Returns Promise<FileSystemEntity[]>
getEntitiesSync
getEntitiesSync(onError?: (error: any) => any): FileSystemEntity[]
Gets all the top-level entities residing within this folder synchronously.
Parameter | Default | Description |
onError |
| (error: any) => any An optional function to be called if some error occurs. |
Returns FileSystemEntity[]
getFile
getFolder
exists
Static
Checks whether a Folder with the specified path already exists.
Parameter | Default | Description |
path |
| string The path to check for. |
Returns boolean
- Previous
- FlexboxLayout
- Next
- Font