| title | Folder |
|---|---|
| titleTemplate | title - API / NativeScript |
| description | Represents a Folder (directory) entity on the file system. |
| contributors | false |
Defined in: file-system/index.d.ts:221
Represents a Folder (directory) entity on the file system.
new Folder(): Folder;Folder
isKnown: boolean;Defined in: file-system/index.d.ts:225
Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
lastModified: Date;Defined in: file-system/index.d.ts:31
Gets the Date object specifying the last time this entity was modified.
name: string;Defined in: file-system/index.d.ts:36
Gets the name of the entity.
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.
path: string;Defined in: file-system/index.d.ts:41
Gets the fully-qualified path (including the extension for a File) of the entity.
clear(): Promise<any>;Defined in: file-system/index.d.ts:249
Deletes all the files and folders (recursively), contained within this Folder.
Promise<any>
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.
| Parameter | Type | Description |
|---|---|---|
onError? |
(error: any) => void |
An optional function to be called if some error occurs. |
void
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.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of the entity to check for. |
boolean
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.
| 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. |
any
getEntities(): Promise<FileSystemEntity[]>;Defined in: file-system/index.d.ts:272
Gets all the top-level entities residing within this folder.
Promise<FileSystemEntity[]>
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.
| Parameter | Type | Description |
|---|---|---|
onError? |
(error: any) => any |
An optional function to be called if some error occurs. |
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.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of the file to get/create. |
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.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name of the folder to get/create. |
Folder
remove(): Promise<any>;Defined in: file-system/index.d.ts:53
Removes (deletes) the current Entity from the file system.
Promise<any>
removeSync(onError?: (error: any) => any): void;Defined in: file-system/index.d.ts:58
Removes (deletes) the current Entity from the file system synchronously.
| Parameter | Type |
|---|---|
onError? |
(error: any) => any |
void
rename(newName: string): Promise<any>;Defined in: file-system/index.d.ts:64
Renames the current entity using the specified name.
| Parameter | Type | Description |
|---|---|---|
newName |
string |
The new name to be applied to the entity. |
Promise<any>
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.
| Parameter | Type | Description |
|---|---|---|
newName |
string |
The new name to be applied to the entity. |
onError? |
(error: any) => any |
- |
void
static exists(path: string): boolean;Defined in: file-system/index.d.ts:237
Checks whether a Folder with the specified path already exists.
| Parameter | Type | Description |
|---|---|---|
path |
string |
The path to check for. |
boolean
static fromPath(path: string): Folder;Defined in: file-system/index.d.ts:231
Gets or creates a Folder entity at the specified path.
| Parameter | Type | Description |
|---|---|---|
path |
string |
The path to get/create the folder at. |
Folder