From 14f53312475d290ac34295ebd43628f5ed5c344c Mon Sep 17 00:00:00 2001 From: Annie_wang Date: Tue, 13 Jun 2023 20:01:33 +0800 Subject: [PATCH] fixed 6ba41a7 from https://gitee.com/Annie_wang/docs_2/pulls/19640 update docs Signed-off-by: Annie_wang --- .../reference/apis/js-apis-file-backup.md | 10 +++++----- .../reference/apis/js-apis-file-fileuri.md | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-file-backup.md b/en/application-dev/reference/apis/js-apis-file-backup.md index c6842fef71..2c2586c953 100644 --- a/en/application-dev/reference/apis/js-apis-file-backup.md +++ b/en/application-dev/reference/apis/js-apis-file-backup.md @@ -22,7 +22,7 @@ Defines a file metadata object, which includes the application name and file URI | Name | Type | Mandatory| Description | | ---------- | ------ | ---- | ---------------------------------------------------------------------------------------------- | | bundleName | string | Yes | Bundle name of the application, which can be obtained by using the method provided by [bundle.BundleInfo](js-apis-bundle-BundleInfo.md). | -| uri | string | Yes | Name of the file in the application sandbox.
Currently, the URI has not been upgraded to the standard format. It can consist of digits (0–9), letters (a–z and A–Z), underscores (_), and period (.) only.| +| uri | string | Yes | URI of the file in the application sandbox.
Currently, the URI is not in the standard format. It can consist of digits (0–9), letters (a–z and A–Z), underscores (_), and period (.) only.| ## FileData @@ -51,7 +51,7 @@ inherits from [FileMeta](#filemeta) and [FileData](#filedata). ## GeneralCallbacks -Provides general callbacks invoked during the backup or restoration process. The backup service uses these callbacks to notify the client of the backup/restoration phase of the application. +Provides callbacks to be used in the backup or restoration process. The backup service uses these callbacks to notify the client of the backup/restoration phase of the application. **System capability**: SystemCapability.FileManagement.StorageService.Backup @@ -263,7 +263,7 @@ The following is an example of the file obtained: "versionCode" : 1000000, "versionName" : "1.0.0" }], - "deviceType" : "phone", + "deviceType" : "default", "systemFullName" : "OpenHarmony-4.0.0.0" } ``` @@ -324,7 +324,7 @@ For details about the error codes, see [File Management Error Codes](../errorcod "versionCode" : 1000000, "versionName" : "1.0.0" }], - "deviceType" : "phone", + "deviceType" : "default", "systemFullName" : "OpenHarmony-4.0.0.0" } ``` @@ -546,7 +546,7 @@ For details about the error codes, see [File Management Error Codes](../errorcod ## SessionRestore -Provides a restoration process object to support the data restoration process of applications. Before using the APIs of this class, you need to create a **SessionRestore** instance. +Provides an object to support the data restoration process of applications. Before using the APIs of this class, you need to create a **SessionRestore** instance. ### constructor diff --git a/en/application-dev/reference/apis/js-apis-file-fileuri.md b/en/application-dev/reference/apis/js-apis-file-fileuri.md index 1aa5fe9cf0..f713a5d0ee 100644 --- a/en/application-dev/reference/apis/js-apis-file-fileuri.md +++ b/en/application-dev/reference/apis/js-apis-file-fileuri.md @@ -14,6 +14,8 @@ import fileuri from "@ohos.file.fileuri"; Before using this module, you need to obtain the path of the file in the application sandbox. The following is an example: +**Stage Model** + ```js import UIAbility from '@ohos.app.ability.UIAbility'; @@ -25,6 +27,19 @@ export default class EntryAbility extends UIAbility { } ``` +**FA Model** + + ```js + import featureAbility from '@ohos.ability.featureAbility'; + + let context = featureAbility.getContext(); + context.getFilesDir().then((data) => { + let pathDir = data; + }) + ``` + +For details about how to obtain the FA model context, see [Context](js-apis-inner-app-context.md#context). + ## fileUri.getUriFromPath getUriFromPath(path: string): string -- GitLab