未验证 提交 af924752 编写于 作者: O openharmony_ci 提交者: Gitee

!15547 [翻译完成】#I6HQCD

Merge pull request !15547 from Annie_wang/PR10539A
...@@ -38,7 +38,7 @@ Obtains a **Preferences** instance. This API uses an asynchronous callback to re ...@@ -38,7 +38,7 @@ Obtains a **Preferences** instance. This API uses an asynchronous callback to re
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ | | -------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance.| | name | string | Yes | Name of the **Preferences** instance.|
| callback | AsyncCallback&lt;[Preferences](#preferences)&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **object** is the **Preferences** instance obtained. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;[Preferences](#preferences)&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **object** is the **Preferences** instance obtained. Otherwise, **err** is an error code.|
...@@ -55,41 +55,39 @@ let preferences = null; ...@@ -55,41 +55,39 @@ let preferences = null;
try { try {
data_preferences.getPreferences(context, 'mystore', function (err, val) { data_preferences.getPreferences(context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Got the preferences successfully."); preferences = val;
console.info("Obtained the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
} }
``` ```
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null; let preferences = null;
class EntryAbility extends UIAbility { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){ onWindowStageCreate(windowStage) {
context = this.context; try {
} data_preferences.getPreferences(this.context, 'mystore', function (err, val) {
}
let preferences = null;
try {
data_preferences.getPreferences(context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Got the preferences successfully."); preferences = val;
console.info("Obtained the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -105,7 +103,7 @@ Obtains a **Preferences** instance. This API uses a promise to return the result ...@@ -105,7 +103,7 @@ Obtains a **Preferences** instance. This API uses a promise to return the result
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance.| | name | string | Yes | Name of the **Preferences** instance.|
**Return value** **Return value**
...@@ -128,40 +126,36 @@ try { ...@@ -128,40 +126,36 @@ try {
let promise = data_preferences.getPreferences(context, 'mystore'); let promise = data_preferences.getPreferences(context, 'mystore');
promise.then((object) => { promise.then((object) => {
preferences = object; preferences = object;
console.info("Got the preferences successfully."); console.info("Obtained the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
} }
``` ```
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null; let preferences = null;
class EntryAbility extends UIAbility { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){ onWindowStageCreate(windowStage) {
context = this.context; try {
} let promise = data_preferences.getPreferences(this.context, 'mystore');
}
let preferences = null;
try {
let promise = data_preferences.getPreferences(context, 'mystore');
promise.then((object) => { promise.then((object) => {
preferences = object; preferences = object;
console.info("Got the preferences successfully."); console.info("Obtained the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to get the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -181,7 +175,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi ...@@ -181,7 +175,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---------------------------------------------------- | | -------- | ------------------------------------- | ---- | ---------------------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to delete. | | name | string | Yes | Name of the **Preferences** instance to delete. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.|
...@@ -218,27 +212,22 @@ try { ...@@ -218,27 +212,22 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){ onWindowStageCreate(windowStage) {
context = this.context; try {
} data_preferences.deletePreferences(this.context, 'mystore', function (err, val) {
}
try {
data_preferences.deletePreferences(context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Deleted the preferences successfully." ); console.info("Deleted the preferences successfully." );
}) })
} catch (err) { } catch (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -258,7 +247,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi ...@@ -258,7 +247,7 @@ The deleted **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to delete.| | name | string | Yes | Name of the **Preferences** instance to delete.|
**Return value** **Return value**
...@@ -299,26 +288,21 @@ try { ...@@ -299,26 +288,21 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){ onWindowStageCreate(windowStage) {
context = this.context; try{
} let promise = data_preferences.deletePreferences(this.context, 'mystore');
}
try{
let promise = data_preferences.deletePreferences(context, 'mystore');
promise.then(() => { promise.then(() => {
console.info("Deleted the preferences successfully."); console.info("Deleted the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -336,7 +320,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi ...@@ -336,7 +320,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---------------------------------------------------- | | -------- | ------------------------------------- | ---- | ---------------------------------------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to remove. | | name | string | Yes | Name of the **Preferences** instance to remove. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error code.|
...@@ -365,27 +349,22 @@ try { ...@@ -365,27 +349,22 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility { class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){ onWindowStageCreate(windowStage) {
context = this.context; try {
} data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err, val) {
}
try {
data_preferences.removePreferencesFromCache(context, 'mystore', function (err, val) {
if (err) { if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Removed the preferences successfully."); console.info("Removed the preferences successfully.");
}) })
} catch (err) { } catch (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -404,7 +383,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi ...@@ -404,7 +383,7 @@ The removed **Preferences** instance cannot be used for data operations. Otherwi
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------- | | ------- | ------------------------------------- | ---- | ----------------------- |
| context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-ability-context.md). | | context | Context | Yes | Application context.<br>For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).<br>For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). |
| name | string | Yes | Name of the **Preferences** instance to remove.| | name | string | Yes | Name of the **Preferences** instance to remove.|
**Return value** **Return value**
...@@ -437,24 +416,21 @@ try { ...@@ -437,24 +416,21 @@ try {
Stage model: Stage model:
```ts ```ts
// Obtain the context.
import UIAbility from '@ohos.app.ability.UIAbility'; import UIAbility from '@ohos.app.ability.UIAbility';
let context = null;
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
context = this.context;
}
}
try { class EntryAbility extends UIAbility {
let promise = data_preferences.removePreferencesFromCache(context, 'mystore'); onWindowStageCreate(windowStage) {
try {
let promise = data_preferences.removePreferencesFromCache(this.context, 'mystore');
promise.then(() => { promise.then(() => {
console.info("Removed the preferences successfully."); console.info("Removed the preferences successfully.");
}).catch((err) => { }).catch((err) => {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message); console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
}
}
} }
``` ```
...@@ -469,7 +445,7 @@ Before calling any method of **Preferences**, you must obtain a **Preferences** ...@@ -469,7 +445,7 @@ Before calling any method of **Preferences**, you must obtain a **Preferences**
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
Obtains the value of a key. This API uses an asynchronous callback to return the result. If the value is **null** or is not the type of the default value, the default value is returned. Obtains the value of a key. This API uses an asynchronous callback to return the result. If the value is **null** or is not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -487,13 +463,13 @@ Obtains the value of a key. This API uses an asynchronous callback to return the ...@@ -487,13 +463,13 @@ Obtains the value of a key. This API uses an asynchronous callback to return the
try { try {
preferences.get('startup', 'default', function (err, val) { preferences.get('startup', 'default', function (err, val) {
if (err) { if (err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
return; return;
} }
console.info("Obtained the value of 'startup' successfully. val: " + val); console.info("Obtained the value of 'startup' successfully. val: " + val);
}) })
} catch (err) { } catch (err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
} }
``` ```
...@@ -502,7 +478,7 @@ try { ...@@ -502,7 +478,7 @@ try {
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt; get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
Obtains the value of a key. This API uses a promise to return the result. If the value is **null** or is not the type of the default value, the default value is returned. Obtains the value of a key. This API uses a promise to return the result. If the value is **null** or is not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -530,7 +506,7 @@ try { ...@@ -530,7 +506,7 @@ try {
console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to get value of 'startup'. code =" + err.code + ", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.info("Failed to get the value of 'startup'. code =" + err.code + ", message =" + err.message); console.info("Failed to obtain the value of 'startup'. code =" + err.code + ", message =" + err.message);
} }
``` ```
...@@ -672,7 +648,7 @@ try { ...@@ -672,7 +648,7 @@ try {
has(key: string, callback: AsyncCallback&lt;boolean&gt;): void has(key: string, callback: AsyncCallback&lt;boolean&gt;): void
Checks whether this **Preferences** instance contains a KV pair with the given key. This API uses an asynchronous callback to return the result.. Checks whether this **Preferences** instance contains a KV pair with the given key. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -708,7 +684,7 @@ try { ...@@ -708,7 +684,7 @@ try {
has(key: string): Promise&lt;boolean&gt; has(key: string): Promise&lt;boolean&gt;
Checks whether this **Preferences** instance contains a KV pair with the given key. This API uses a promise to return the result.. Checks whether this **Preferences** instance contains a KV pair with the given key. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -804,10 +780,10 @@ try { ...@@ -804,10 +780,10 @@ try {
promise.then(() => { promise.then(() => {
console.info("Deleted the key 'startup'."); console.info("Deleted the key 'startup'.");
}).catch((err) => { }).catch((err) => {
console.log("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message); console.info("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message);
}) })
} catch(err) { } catch(err) {
console.log("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message); console.info("Failed to delete the key 'startup'. code =" + err.code +", message =" + err.message);
} }
``` ```
...@@ -955,7 +931,7 @@ Subscribes to data changes. A callback will be triggered to return the new value ...@@ -955,7 +931,7 @@ Subscribes to data changes. A callback will be triggered to return the new value
try { try {
data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) { data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) {
if (err) { if (err) {
console.info("Failed to get the preferences."); console.info("Failed to obtain the preferences.");
return; return;
} }
let observer = function (key) { let observer = function (key) {
...@@ -1005,7 +981,7 @@ Unsubscribes from data changes. ...@@ -1005,7 +981,7 @@ Unsubscribes from data changes.
try { try {
data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) { data_preferences.getPreferences(this.context, 'mystore', function (err, preferences) {
if (err) { if (err) {
console.info("Failed to get the preferences."); console.info("Failed to obtain the preferences.");
return; return;
} }
let observer = function (key) { let observer = function (key) {
......
...@@ -367,7 +367,7 @@ Provides APIs for obtaining and modifying storage data. ...@@ -367,7 +367,7 @@ Provides APIs for obtaining and modifying storage data.
getSync(key: string, defValue: ValueType): ValueType getSync(key: string, defValue: ValueType): ValueType
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -396,7 +396,7 @@ console.info("The value of startup is " + value); ...@@ -396,7 +396,7 @@ console.info("The value of startup is " + value);
get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void get(key: string, defValue: ValueType, callback: AsyncCallback&lt;ValueType&gt;): void
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses an asynchronous callback to return the result. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
...@@ -425,7 +425,7 @@ storage.get('startup', 'default', function(err, value) { ...@@ -425,7 +425,7 @@ storage.get('startup', 'default', function(err, value) {
get(key: string, defValue: ValueType): Promise&lt;ValueType&gt; get(key: string, defValue: ValueType): Promise&lt;ValueType&gt;
Obtains the value corresponding to a key. If the value is null or not in the default value format, the default value is returned. This API uses a promise to return the result. Obtains the value corresponding to a key. If the value is null or not of the default value type, **defValue** is returned. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
......
...@@ -211,7 +211,6 @@ Obtains information about the device root nodes of the file management service t ...@@ -211,7 +211,6 @@ Obtains information about the device root nodes of the file management service t
getRoots(callback:AsyncCallback&lt;RootIterator&gt;) : void; getRoots(callback:AsyncCallback&lt;RootIterator&gt;) : void;
Obtains information about the device root nodes of the file management service type connected to the **Helper** object. This API uses an asynchronous callback to return the result. Obtains information about the device root nodes of the file management service type connected to the **Helper** object. This API uses an asynchronous callback to return the result.
The callback has a **RootIterator** object, which returns [RootInfo](#rootinfo) through [next()](#rootiteratornext). The callback has a **RootIterator** object, which returns [RootInfo](#rootinfo) through [next()](#rootiteratornext).
**System capability**: SystemCapability.FileManagement.UserFileService **System capability**: SystemCapability.FileManagement.UserFileService
...@@ -255,7 +254,7 @@ The callback has a **RootIterator** object, which returns [RootInfo](#rootinfo) ...@@ -255,7 +254,7 @@ The callback has a **RootIterator** object, which returns [RootInfo](#rootinfo)
listFile(filter?: Filter) : FileIterator listFile(filter?: Filter) : FileIterator
Synchronously obtains the **FileIterator** object of the first-level files (file directory) matching the conditions of the filter from the device root node. The **FileIterator** object then returns [FileInfo](#fileinfo) by using [next()](#fileiteratornext). Synchronously obtains the **FileIterator** object of the first-level files (directory) matching the conditions of the filter from the device root node. The **FileIterator** object then returns [FileInfo](#fileinfo) by using [next()](#fileiteratornext).
**System capability**: SystemCapability.FileManagement.UserFileService **System capability**: SystemCapability.FileManagement.UserFileService
...@@ -356,7 +355,7 @@ Recursively obtains the **FileIterator** object of the files matching the condit ...@@ -356,7 +355,7 @@ Recursively obtains the **FileIterator** object of the files matching the condit
listFile(filter?: Filter) : FileIterator listFile(filter?: Filter) : FileIterator
Synchronously obtains the **FileIterator** object of the next-level files (file directories) matching the conditions of the filter from a directory. The **FileIterator** object then returns [FileInfo](#fileinfo) by using [next()](#fileiteratornext). Synchronously obtains the **FileIterator** object of the next-level files (directories) matching the conditions of the filter from a directory. The **FileIterator** object then returns [FileInfo](#fileinfo) by using [next()](#fileiteratornext).
**System capability**: SystemCapability.FileManagement.UserFileService **System capability**: SystemCapability.FileManagement.UserFileService
......
...@@ -14,7 +14,7 @@ The **PermissionRequestResult** module defines the result of a permission reques ...@@ -14,7 +14,7 @@ The **PermissionRequestResult** module defines the result of a permission reques
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| permissions | Array&lt;string&gt; | Yes| No| Permissions requested.| | permissions | Array&lt;string&gt; | Yes| No| Permissions requested.|
| authResults | Array&lt;number&gt; | Yes| No|Resule of the permission Request.<br>**-1**: The permission has been set and no dialog box will be displayed. Users can modify the permission in **Settings**.<br>**0**: No operation is required.<br>**1**: Dynamic user authorization is required via a dialog window .<br>**2**: The request is invalid. Possible causes are as follows:<br>- The permission is not declared in the configuration file.<br>- The permission name is invalid.<br>- Special conditions for applying for the permission do not satisfied. See [ohos.permission.LOCATION](../../security/permission-list.md#ohospermissionlocation) and [ohos.permission.APPROXIMATELY_LOCATION](../../security/permission-list.md#ohospermissionapproximately_location).| | authResults | Array&lt;number&gt; | Yes| No|Result of the permission Request.<br>**-1**: The permission has been set and no dialog box will be displayed. Users can modify the permission in **Settings**.<br>**0**: No operation is required.<br>**1**: Dynamic user authorization is required via a dialog window .<br>**2**: The request is invalid. Possible causes are as follows:<br>- The permission is not declared in the configuration file.<br>- The permission name is invalid.<br>- Special conditions for applying for the permission do not satisfied. See [ohos.permission.LOCATION](../../security/permission-list.md#ohospermissionlocation) and [ohos.permission.APPROXIMATELY_LOCATION](../../security/permission-list.md#ohospermissionapproximately_location).|
## Usage ## Usage
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册