Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c4766545
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4766545
编写于
3月 30, 2022
作者:
Z
zhangxingxia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete api9
Signed-off-by:
N
zhangxingxia
<
zhangxingxia1@huawei.com
>
上级
71d300d0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
0 addition
and
247 deletion
+0
-247
en/application-dev/reference/apis/Readme-EN.md
en/application-dev/reference/apis/Readme-EN.md
+0
-1
en/application-dev/reference/apis/js-apis-storage-statistics.md
...lication-dev/reference/apis/js-apis-storage-statistics.md
+0
-67
en/application-dev/reference/apis/js-apis-volumemanager.md
en/application-dev/reference/apis/js-apis-volumemanager.md
+0
-179
未找到文件。
en/application-dev/reference/apis/Readme-EN.md
浏览文件 @
c4766545
...
...
@@ -36,7 +36,6 @@
-
[
Environment
](
js-apis-environment.md
)
-
[
Public File Access and Management
](
js-apis-filemanager.md
)
-
[
App Storage Statistics
](
js-apis-storage-statistics.md
)
-
[
Volume Management
](
js-apis-volumemanager.md
)
-
Account Management
-
[
OS Account Management
](
js-apis-osAccount.md
)
-
[
Distributed Account Management
](
js-apis-distributed-account.md
)
...
...
en/application-dev/reference/apis/js-apis-storage-statistics.md
浏览文件 @
c4766545
...
...
@@ -126,70 +126,3 @@ Asynchronously obtains the available space of the specified volume. This method
});
```
## storagestatistics.getBundleStats
getBundleStats(packageName: string): Promise
<
BundleStats
>
Obtains the bundle status. This method uses a promise to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.SpatialStatistics
-
Parameters
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | -------- |
| packageName | string | Yes | Bundle name of the app.|
-
Return value
| Type | Description |
| ------------------------------------------ | -------------------------- |
| Promise
<
[Bundlestats](#bundlestats)
>
| Promise used to return the bundle status on the volume.|
-
Example
```
js
let
packageName
=
""
;
storagestatistics
.
getBundleStats
(
packageName
).
then
(
function
(
BundleStats
){
console
.
info
(
"
getBundleStats successfully:
"
+
JSON
.
stringify
(
BundleStats
));
}).
catch
(
function
(
err
){
console
.
info
(
"
getBundleStats failed with error:
"
+
err
);
});
```
## storagestatistics.getBundleStats
getBundleStats(packageName: string, callback: AsyncCallback
<
BundleStats
>
): void
Obtains the bundle status. This method uses an asynchronous callback to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.SpatialStatistics
-
Parameters
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | ---- | ------------------------------------ |
| packageName | string | Yes | Bundle name of the app.|
| callback | callback:AsyncCallback
<
[Bundlestats](#bundlestats)
>
| Yes | Callback invoked to return the bundle status on the volume.|
-
Example
```
js
let
packageName
=
""
;
storagestatistics
.
getBundleStats
(
packageName
,
function
(
error
,
BundleStats
){
// Do something
console
.
info
(
"
getBundleStats successfully:
"
+
JSON
.
stringify
(
BundleStats
));
});
```
## BundleStats<sup>9+</sup>
**System capability**
: SystemCapability.FileManagement.StorageService.SpatialStatistics
### Attributes
| Name | Type | Description |
| --------- | ------ | -------------- |
| appSize
<sup>
9+
</sup>
| number | Size of the app. |
| cacheSize
<sup>
9+
</sup>
| number | Size of the cached data. |
| dataSize
<sup>
9+
</sup>
| number | Total data size of the app.|
en/application-dev/reference/apis/js-apis-volumemanager.md
已删除
100644 → 0
浏览文件 @
71d300d0
# Volume Management
> ![icon-note.gif](public_sys-resources/icon-note.gif) **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.
> - This is a system API and cannot be called by third-party applications.
## Modules to Import
```
js
import
volumemanager
from
"
@ohos.volumeManager
"
;
```
## volumemanager.getAllVolumes<sup>9+</sup>
getAllVolumes(): Promise
<
Array
<
Volume
>>
Asynchronously obtains information about all available volumes. This method uses a promise to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Return value
| Type | Description |
| ---------------------------------- | -------------------------- |
| Promise
<
[Volume](#volume)[]
>
| Promise used to return the execution result.|
-
Example
```
js
volumemanager
.
getAllVolumes
().
then
(
function
(
volumes
){
// do something
});
```
## volumemanager.getAllVolumes<sup>9+</sup>
getAllVolumes(callback: AsyncCallback
<
Array
<
Volume
>>
): void
Asynchronously obtains information about all available volumes. This method uses a callback to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Parameters
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------- | ---- | ------------------------------------ |
| callback | callback:AsyncCallback
<
[Volume](#volume)[]
>
| Yes | Callback invoked to return the volume information obtained.|
-
Example
```
js
let
uuid
=
""
;
volumemanager
.
getAllVolumes
(
uuid
,
function
(
error
,
volumes
){
// do something
});
```
## volumemanager.mount<sup>9+</sup>
mount(volumeId: string): Promise
<
boolean
>
Asynchronously mounts a volume. This method uses a promise to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Parameters
| Name | Type | Mandatory| Description|
| -------- | ------ | ---- | ---- |
| volumeId | string | Yes | Volume ID.|
-
Return value
| Type | Description |
| ---------------------- | ---------- |
| Promise
<
boolean
>
| Promise used to return the execution result.|
-
Example
```
js
let
volumeId
=
""
;
volumemanager
.
mount
(
volumeId
).
then
(
function
(
flag
){
// do something
});
```
## volumemanager.mount<sup>9+</sup>
mount(volumeId: string, callback:AsyncCallback
<
boolean
>
):void
Asynchronously obtains the available space of the specified volume. This method uses a callback to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Parameters
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | -------------------- |
| volumeId | string | Yes | Volume ID. |
| callback | callback:AsyncCallback
<
boolean
>
| Yes | Callback invoked to return the execution result.|
-
Example
```
js
let
volumeId
=
""
;
volumemanager
.
mount
(
volumeId
,
function
(
error
,
flag
){
// do something
});
```
## volumemanager.unmount<sup>9+</sup>
unmount(volumeId: string): Promise
<
boolean
>
Asynchronously unmounts a volume. This method uses a promise to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Parameters
| Name | Type | Mandatory| Description|
| -------- | ------ | ---- | ---- |
| volumeId | string | Yes | Volume ID.|
-
Return value
| Type | Description |
| ---------------------- | ---------- |
| Promise
<
boolean
>
| Promise used to return the execution result.|
-
Example
```
js
let
volumeId
=
""
;
volumemanager
.
unmount
(
volumeId
).
then
(
function
(
flag
){
// do something
});
```
## volumemanager.unmount<sup>9+</sup>
unmount(volumeId: string, callback:AsyncCallback
<
boolean
>
):void
Asynchronously unmounts a volume. This method uses a callback to return the result.
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
-
Parameters
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | -------------------- |
| volumeId | string | Yes | Volume ID. |
| callback | callback:AsyncCallback
<
boolean
>
| Yes | Callback invoked to return the execution result.|
-
Example
```
js
let
volumeId
=
""
;
volumemanager
.
unmount
(
volumeId
,
function
(
error
,
flag
){
// do something
});
```
## Volume<sup>9+</sup>
**System capability**
: SystemCapability.FileManagement.StorageService.Volume
### Attributes
| Name | Type | Description |
| ----------- | ------- | -------------------- |
| id
<sup>
9+
</sup>
| number | Volume ID. |
| uuid
<sup>
9+
</sup>
| string | Universally unique identifier (UUID) of the volume. |
| description
<sup>
9+
</sup>
| string | Description of the volume. |
| removable
<sup>
9+
</sup>
| boolean | Whether the volume is a removable storage device.|
| state
<sup>
9+
</sup>
| int | Current volume status. |
| path
<sup>
9+
</sup>
| string | Mount address of the volume. |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录