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

!6778 【翻译完成】#I5G22E

Merge pull request !6778 from Annie_wang/PR6504
# User File Access and Management # User File Access and Management
The fileManager module provides APIs for accessing and managing user files. It interworks with the underlying file management services to implement media library and external card management, and provides capabilities for applications to query and create user files.
>**NOTE**<br/> >**NOTE**<br/>
> >
>- The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. >- The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>- The APIs of this module are system APIs and cannot be called by third-party applications. Currently, these APIs can be called only by **filepicker**. >- The APIs of this module are system APIs and cannot be called by third-party applications. Currently, these APIs can be called only by **filepicker**.
Provides service APIs for accessing and managing user files. It interworks with the underlying file management services to implement media library and external card management, and provides capabilities for applications to query and create user files.
## Modules to Import ## Modules to Import
```js ```js
......
# Security Label # Security Label
The secuityLabel module provides APIs to manage file data security levels, including obtaining and setting file data security levels.
> **NOTE**<br/> > **NOTE**<br/>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Manages file data security levels, including obtaining and setting file data security levels.
## Modules to Import ## Modules to Import
```js ```js
......
# statfs # statfs
> **NOTE:**<br> The statfs module provides APIs for obtaining file system information, including the total number of bytes and the number of idle bytes of the file system.
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Obtains file system information, including the total number of bytes and the number of idle bytes of the file system. > **NOTE**<br>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import ## Modules to Import
...@@ -63,7 +63,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo ...@@ -63,7 +63,7 @@ Obtains the number of free bytes of the specified file system in asynchronous mo
let context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then(function (path) { context.getFilesDir().then(function (path) {
statfs.getFreeBytes(path, function(err, number){ statfs.getFreeBytes(path, function(err, number){
console.info("getFreeBytes callback successfully:"+ number); console.info("Got free bytes successfully:"+ number);
}); });
}); });
``` ```
...@@ -121,7 +121,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m ...@@ -121,7 +121,7 @@ Obtains the total number of bytes of the specified file system in asynchronous m
let context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then(function (path) { context.getFilesDir().then(function (path) {
statfs.getTotalBytes(path, function(err, number){ statfs.getTotalBytes(path, function(err, number){
console.info("getTotalBytes callback successfully:"+ number); console.info("Got total bytes successfully:"+ number);
}); });
}); });
``` ```
# App Storage Statistics # App Storage Statistics
The storageStatistics module provides APIs for obtaining storage space information, including the space of built-in and plug-in memory cards, space occupied by different types of data, and space of application data.
> **NOTE**<br/> > **NOTE**<br/>
> >
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - API version 9 is a canary version for trial use. The APIs of this version may be unstable. > - API version 9 is a canary version for trial use. The APIs of this version may be unstable.
Obtains storage space information, including the space of built-in and plug-in memory cards, space occupied by different types of data, and space of application data.
## Modules to Import ## Modules to Import
```js ```js
......
# Volume Management # Volume Management
The volumeManager module provides APIs for volume and disk management, including obtaining volume information, mounting or unmounting volumes, partitioning disks, and formatting volumes.
> **NOTE**<br> > **NOTE**<br>
> >
> - The initial APIs of this module are supported since API version 9. > - The initial APIs of this module are supported since API version 9.
> - API version 9 is a canary version for trial use. The APIs of this version may be unstable. > - API version 9 is a canary version for trial use. The APIs of this version may be unstable.
> - The APIs of this module are system APIs and cannot be called by third-party applications. > - The APIs of this module are system APIs and cannot be called by third-party applications.
Performs volume and disk management, including obtaining volume information, mounting and unmounting volumes, partitioning disks, and formatting volumes.
## Modules to Import ## Modules to Import
```js ```js
...@@ -59,7 +59,7 @@ Asynchronously obtains information about all available volumes. This API uses a ...@@ -59,7 +59,7 @@ Asynchronously obtains information about all available volumes. This API uses a
```js ```js
let uuid = ""; let uuid = "";
volumemanager.getAllVolumes(function(error, volumes){ volumemanager.getAllVolumes(function(error, volumes){
// Do something. // Do something
}); });
``` ```
...@@ -91,7 +91,7 @@ Asynchronously mounts a volume. This API uses a promise to return the result. ...@@ -91,7 +91,7 @@ Asynchronously mounts a volume. This API uses a promise to return the result.
```js ```js
let volumeId = ""; let volumeId = "";
volumemanager.mount(volumeId).then(function(flag){ volumemanager.mount(volumeId).then(function(flag){
// Do something. // Do something
}); });
``` ```
...@@ -117,7 +117,7 @@ Asynchronously obtains the available space of the specified volume. This API use ...@@ -117,7 +117,7 @@ Asynchronously obtains the available space of the specified volume. This API use
```js ```js
let volumeId = ""; let volumeId = "";
volumemanager.mount(volumeId, function(error, flag){ volumemanager.mount(volumeId, function(error, flag){
// Do something. // Do something
}); });
``` ```
...@@ -148,7 +148,7 @@ Asynchronously unmounts a volume. This API uses a promise to return the result. ...@@ -148,7 +148,7 @@ Asynchronously unmounts a volume. This API uses a promise to return the result.
```js ```js
let volumeId = ""; let volumeId = "";
volumemanager.unmount(volumeId).then(function(flag){ volumemanager.unmount(volumeId).then(function(flag){
// Do something. // Do something
}); });
``` ```
...@@ -174,7 +174,7 @@ Asynchronously unmounts a volume. This API uses a callback to return the result. ...@@ -174,7 +174,7 @@ Asynchronously unmounts a volume. This API uses a callback to return the result.
```js ```js
let volumeId = ""; let volumeId = "";
volumemanager.unmount(volumeId, function(error, flag){ volumemanager.unmount(volumeId, function(error, flag){
// Do something. // Do something
}); });
``` ```
...@@ -182,7 +182,7 @@ Asynchronously unmounts a volume. This API uses a callback to return the result. ...@@ -182,7 +182,7 @@ Asynchronously unmounts a volume. This API uses a callback to return the result.
getVolumeByUuid(uuid: string): Promise&lt;Volume&gt; getVolumeByUuid(uuid: string): Promise&lt;Volume&gt;
Asynchronously obtains volume information based on the Universally unique identifier (UUID). This API uses a promise to return the result. Asynchronously obtains volume information based on the universally unique identifier (UUID). This API uses a promise to return the result.
**Required permissions**: ohos.permission.STORAGE_MANAGER **Required permissions**: ohos.permission.STORAGE_MANAGER
...@@ -198,7 +198,7 @@ Asynchronously obtains volume information based on the Universally unique identi ...@@ -198,7 +198,7 @@ Asynchronously obtains volume information based on the Universally unique identi
| Type | Description | | Type | Description |
| ---------------------------------- | -------------------------- | | ---------------------------------- | -------------------------- |
| Promise&lt;[Volume](#volume)&gt; | Promise used to return the execution result.| | Promise&lt;[Volume](#volume)&gt; | Promise used to return the volume information obtained.|
**Example** **Example**
...@@ -253,7 +253,7 @@ Asynchronously obtains volume information based on the volume ID. This API uses ...@@ -253,7 +253,7 @@ Asynchronously obtains volume information based on the volume ID. This API uses
| Type | Description | | Type | Description |
| ---------------------------------- | -------------------------- | | ---------------------------------- | -------------------------- |
| Promise&lt;[Volume](#volume)&gt; | Promise used to return the execution result.| | Promise&lt;[Volume](#volume)&gt; | Promise used to return the volume information obtained.|
**Example** **Example**
...@@ -309,7 +309,7 @@ Asynchronously sets the volume description based on the UUID. This API uses a pr ...@@ -309,7 +309,7 @@ Asynchronously sets the volume description based on the UUID. This API uses a pr
| Type | Description | | Type | Description |
| ---------------------- | -------------------------- | | ---------------------- | -------------------------- |
| Promise&lt;void&gt; | Promise used to return the volume description. | | Promise&lt;void&gt; | Promise used to return the result. |
**Example** **Example**
...@@ -335,7 +335,7 @@ Asynchronously sets the volume description based on the UUID. This API uses a ca ...@@ -335,7 +335,7 @@ Asynchronously sets the volume description based on the UUID. This API uses a ca
| ---------- | --------------------------------------- | ---- | ---------------- | | ---------- | --------------------------------------- | ---- | ---------------- |
| uuid | string | Yes | UUID of the volume. | | uuid | string | Yes | UUID of the volume. |
| description | string | Yes | Volume description. | | description | string | Yes | Volume description. |
| callback | callback:AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the volume description.| | callback | callback:AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result.|
**Example** **Example**
...@@ -473,5 +473,5 @@ Asynchronously partitions a disk. This API uses a callback to return the result. ...@@ -473,5 +473,5 @@ Asynchronously partitions a disk. This API uses a callback to return the result.
| uuid | string | UUID of the volume. | | uuid | string | UUID of the volume. |
| description | string | Description of the volume. | | description | string | Description of the volume. |
| removable | boolean | Whether the volume is a removable storage device.| | removable | boolean | Whether the volume is a removable storage device.|
| state | number | Current volume status. | | state | number | Volume state. |
| path | string | Mount address of the volume. | | path | string | Mount address of the volume. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册