Classes
Folder
Represents a Folder (directory) entity on the file system.
Defined in: file-system/index.d.ts:221
Represents a Folder (directory) entity on the file system.
Extends
Constructors
Constructor
new Folder(): Folder;Returns
Folder
Inherited from
Properties
isKnown
isKnown: boolean;Defined in: file-system/index.d.ts:225
Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
lastModified
lastModified: Date;Defined in: file-system/index.d.ts:31
Gets the Date object specifying the last time this entity was modified.
Inherited from
name
name: string;Defined in: file-system/index.d.ts:36
Gets the name of the entity.
Inherited from
parent
parent: Folder;Defined in: file-system/index.d.ts:48
Gets the Folder object representing the parent of this entity. Will be null for a root folder like Documents or Temporary. This property is readonly.
Inherited from
path
path: string;Defined in: file-system/index.d.ts:41
Gets the fully-qualified path (including the extension for a File) of the entity.
Inherited from
Methods
clear()
clear(): Promise<any>;Defined in: file-system/index.d.ts:249
Deletes all the files and folders (recursively), contained within this Folder.
Returns
Promise<any>
clearSync()
clearSync(onError?: (error: any) => void): void;Defined in: file-system/index.d.ts:255
Deletes all the files and folders (recursively), contained within this Folder synchronously.
Parameters
| Parameter | Type | Description |
|---|---|---|
onError? | (error: any) => void | An optional function to be called if some error occurs. |
Returns
void
contains()
contains(name: string): boolean;Defined in: file-system/index.d.ts:244
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.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the entity to check for. |
Returns
boolean
eachEntity()
eachEntity(onEntity: (entity: FileSystemEntity) => boolean): any;Defined in: file-system/index.d.ts:284
Enumerates all the top-level FileSystem entities residing within this folder.
Parameters
| Parameter | Type | 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[]>;Defined in: file-system/index.d.ts:272
Gets all the top-level entities residing within this folder.
Returns
Promise<FileSystemEntity[]>
getEntitiesSync()
getEntitiesSync(onError?: (error: any) => any): FileSystemEntity[];Defined in: file-system/index.d.ts:278
Gets all the top-level entities residing within this folder synchronously.
Parameters
| Parameter | Type | Description |
|---|---|---|
onError? | (error: any) => any | An optional function to be called if some error occurs. |
Returns
getFile()
getFile(name: string): File;Defined in: file-system/index.d.ts:261
Gets or creates a File entity with the specified name within this Folder.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the file to get/create. |
Returns
getFolder()
getFolder(name: string): Folder;Defined in: file-system/index.d.ts:267
Gets or creates a Folder entity with the specified name within this Folder.
Parameters
| Parameter | Type | Description |
|---|---|---|
name | string | The name of the folder to get/create. |
Returns
Folder
remove()
remove(): Promise<any>;Defined in: file-system/index.d.ts:53
Removes (deletes) the current Entity from the file system.
Returns
Promise<any>
Inherited from
removeSync()
removeSync(onError?: (error: any) => any): void;Defined in: file-system/index.d.ts:58
Removes (deletes) the current Entity from the file system synchronously.
Parameters
| Parameter | Type |
|---|---|
onError? | (error: any) => any |
Returns
void
Inherited from
rename()
rename(newName: string): Promise<any>;Defined in: file-system/index.d.ts:64
Renames the current entity using the specified name.
Parameters
| Parameter | Type | Description |
|---|---|---|
newName | string | The new name to be applied to the entity. |
Returns
Promise<any>
Inherited from
renameSync()
renameSync(newName: string, onError?: (error: any) => any): void;Defined in: file-system/index.d.ts:70
Renames the current entity synchronously, using the specified name.
Parameters
| Parameter | Type | Description |
|---|---|---|
newName | string | The new name to be applied to the entity. |
onError? | (error: any) => any | - |
Returns
void
Inherited from
exists()
static exists(path: string): boolean;Defined in: file-system/index.d.ts:237
Checks whether a Folder with the specified path already exists.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | The path to check for. |
Returns
boolean
fromPath()
static fromPath(path: string): Folder;Defined in: file-system/index.d.ts:231
Gets or creates a Folder entity at the specified path.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | The path to get/create the folder at. |
Returns
Folder
- Previous
- FlexboxLayout
- Next
- Font