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

!19640 [翻译完成】#I76SB7

Merge pull request !19640 from Annie_wang/PR18425
......@@ -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.<br>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.<br>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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册