161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"),
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit CoreFileKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ciimport Want from './@ohos.app.ability.Want';
2361847f8eSopenharmony_ciimport Context from './application/Context';
2461847f8eSopenharmony_ciimport { Filter } from './@ohos.file.fs';
2561847f8eSopenharmony_ci
2661847f8eSopenharmony_ci/**
2761847f8eSopenharmony_ci * This module provides the capability to access user public files.
2861847f8eSopenharmony_ci *
2961847f8eSopenharmony_ci * @namespace fileAccess
3061847f8eSopenharmony_ci * @syscap SystemCapability.FileManagement.UserFileService
3161847f8eSopenharmony_ci * @since 9
3261847f8eSopenharmony_ci */
3361847f8eSopenharmony_cideclare namespace fileAccess {
3461847f8eSopenharmony_ci  /**
3561847f8eSopenharmony_ci   * Query the want information of HAP configured with fileaccess.
3661847f8eSopenharmony_ci   *
3761847f8eSopenharmony_ci   * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
3861847f8eSopenharmony_ci   * @param { AsyncCallback<Array<Want>> } callback - The callback is used to return a Array<Want> object.
3961847f8eSopenharmony_ci   * @throws { BusinessError } 13900001 - Operation not permitted
4061847f8eSopenharmony_ci   * @throws { BusinessError } 13900002 - No such file or directory
4161847f8eSopenharmony_ci   * @throws { BusinessError } 13900004 - Interrupted system call
4261847f8eSopenharmony_ci   * @throws { BusinessError } 13900006 - No such device or address
4361847f8eSopenharmony_ci   * @throws { BusinessError } 13900008 - Bad file descriptor
4461847f8eSopenharmony_ci   * @throws { BusinessError } 13900011 - Out of memory
4561847f8eSopenharmony_ci   * @throws { BusinessError } 13900012 - Permission denied
4661847f8eSopenharmony_ci   * @throws { BusinessError } 13900013 - Bad address
4761847f8eSopenharmony_ci   * @throws { BusinessError } 13900014 - Device or resource busy
4861847f8eSopenharmony_ci   * @throws { BusinessError } 13900015 - File exists
4961847f8eSopenharmony_ci   * @throws { BusinessError } 13900017 - No such device
5061847f8eSopenharmony_ci   * @throws { BusinessError } 13900018 - Not a directory
5161847f8eSopenharmony_ci   * @throws { BusinessError } 13900019 - Is a directory
5261847f8eSopenharmony_ci   * @throws { BusinessError } 13900020 - Invalid argument
5361847f8eSopenharmony_ci   * @throws { BusinessError } 13900022 - Too many open files
5461847f8eSopenharmony_ci   * @throws { BusinessError } 13900023 - Text file busy
5561847f8eSopenharmony_ci   * @throws { BusinessError } 13900024 - File too large
5661847f8eSopenharmony_ci   * @throws { BusinessError } 13900025 - No space left on device
5761847f8eSopenharmony_ci   * @throws { BusinessError } 13900027 - Read-only file system
5861847f8eSopenharmony_ci   * @throws { BusinessError } 13900029 - Resource deadlock would occur
5961847f8eSopenharmony_ci   * @throws { BusinessError } 13900030 - File name too long
6061847f8eSopenharmony_ci   * @throws { BusinessError } 13900033 - Too many symbolic links encountered
6161847f8eSopenharmony_ci   * @throws { BusinessError } 13900034 - Operation would block
6261847f8eSopenharmony_ci   * @throws { BusinessError } 13900038 - Value too large for defined data type
6361847f8eSopenharmony_ci   * @throws { BusinessError } 13900041 - Quota exceeded
6461847f8eSopenharmony_ci   * @throws { BusinessError } 13900042 - Unknown error
6561847f8eSopenharmony_ci   * @throws { BusinessError } 14300001 - IPC error
6661847f8eSopenharmony_ci   * @throws { BusinessError } 14300002 - Invalid uri
6761847f8eSopenharmony_ci   * @throws { BusinessError } 14300003 - Fail to get fileextension info
6861847f8eSopenharmony_ci   * @throws { BusinessError } 14300004 - Get wrong result
6961847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
7061847f8eSopenharmony_ci   * @systemapi
7161847f8eSopenharmony_ci   * @StageModelOnly
7261847f8eSopenharmony_ci   * @since 9
7361847f8eSopenharmony_ci   */
7461847f8eSopenharmony_ci  function getFileAccessAbilityInfo(callback: AsyncCallback<Array<Want>>): void;
7561847f8eSopenharmony_ci
7661847f8eSopenharmony_ci  /**
7761847f8eSopenharmony_ci   * Query the want information of HAP configured with fileaccess.
7861847f8eSopenharmony_ci   *
7961847f8eSopenharmony_ci   * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
8061847f8eSopenharmony_ci   * @returns { Promise<Array<Want>> } Returns the wants.
8161847f8eSopenharmony_ci   * @throws { BusinessError } 13900001 - Operation not permitted
8261847f8eSopenharmony_ci   * @throws { BusinessError } 13900002 - No such file or directory
8361847f8eSopenharmony_ci   * @throws { BusinessError } 13900004 - Interrupted system call
8461847f8eSopenharmony_ci   * @throws { BusinessError } 13900006 - No such device or address
8561847f8eSopenharmony_ci   * @throws { BusinessError } 13900008 - Bad file descriptor
8661847f8eSopenharmony_ci   * @throws { BusinessError } 13900011 - Out of memory
8761847f8eSopenharmony_ci   * @throws { BusinessError } 13900012 - Permission denied
8861847f8eSopenharmony_ci   * @throws { BusinessError } 13900013 - Bad address
8961847f8eSopenharmony_ci   * @throws { BusinessError } 13900014 - Device or resource busy
9061847f8eSopenharmony_ci   * @throws { BusinessError } 13900015 - File exists
9161847f8eSopenharmony_ci   * @throws { BusinessError } 13900017 - No such device
9261847f8eSopenharmony_ci   * @throws { BusinessError } 13900018 - Not a directory
9361847f8eSopenharmony_ci   * @throws { BusinessError } 13900019 - Is a directory
9461847f8eSopenharmony_ci   * @throws { BusinessError } 13900020 - Invalid argument
9561847f8eSopenharmony_ci   * @throws { BusinessError } 13900022 - Too many open files
9661847f8eSopenharmony_ci   * @throws { BusinessError } 13900023 - Text file busy
9761847f8eSopenharmony_ci   * @throws { BusinessError } 13900024 - File too large
9861847f8eSopenharmony_ci   * @throws { BusinessError } 13900025 - No space left on device
9961847f8eSopenharmony_ci   * @throws { BusinessError } 13900027 - Read-only file system
10061847f8eSopenharmony_ci   * @throws { BusinessError } 13900029 - Resource deadlock would occur
10161847f8eSopenharmony_ci   * @throws { BusinessError } 13900030 - File name too long
10261847f8eSopenharmony_ci   * @throws { BusinessError } 13900033 - Too many symbolic links encountered
10361847f8eSopenharmony_ci   * @throws { BusinessError } 13900034 - Operation would block
10461847f8eSopenharmony_ci   * @throws { BusinessError } 13900038 - Value too large for defined data type
10561847f8eSopenharmony_ci   * @throws { BusinessError } 13900041 - Quota exceeded
10661847f8eSopenharmony_ci   * @throws { BusinessError } 13900042 - Unknown error
10761847f8eSopenharmony_ci   * @throws { BusinessError } 14300001 - IPC error
10861847f8eSopenharmony_ci   * @throws { BusinessError } 14300002 - Invalid uri
10961847f8eSopenharmony_ci   * @throws { BusinessError } 14300003 - Fail to get fileextension info
11061847f8eSopenharmony_ci   * @throws { BusinessError } 14300004 - Get wrong result
11161847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
11261847f8eSopenharmony_ci   * @systemapi
11361847f8eSopenharmony_ci   * @StageModelOnly
11461847f8eSopenharmony_ci   * @since 9
11561847f8eSopenharmony_ci   */
11661847f8eSopenharmony_ci  function getFileAccessAbilityInfo(): Promise<Array<Want>>;
11761847f8eSopenharmony_ci
11861847f8eSopenharmony_ci  /**
11961847f8eSopenharmony_ci   * Obtains the fileAccessHelper that connects all fileaccess servers in the system.
12061847f8eSopenharmony_ci   *
12161847f8eSopenharmony_ci   * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
12261847f8eSopenharmony_ci   * @param { Context } context Indicates the application context.
12361847f8eSopenharmony_ci   * @returns { FileAccessHelper } Returns the fileAccessHelper.
12461847f8eSopenharmony_ci   * @throws { BusinessError } 13900001 - Operation not permitted
12561847f8eSopenharmony_ci   * @throws { BusinessError } 13900002 - No such file or directory
12661847f8eSopenharmony_ci   * @throws { BusinessError } 13900004 - Interrupted system call
12761847f8eSopenharmony_ci   * @throws { BusinessError } 13900006 - No such device or address
12861847f8eSopenharmony_ci   * @throws { BusinessError } 13900008 - Bad file descriptor
12961847f8eSopenharmony_ci   * @throws { BusinessError } 13900011 - Out of memory
13061847f8eSopenharmony_ci   * @throws { BusinessError } 13900012 - Permission denied
13161847f8eSopenharmony_ci   * @throws { BusinessError } 13900013 - Bad address
13261847f8eSopenharmony_ci   * @throws { BusinessError } 13900014 - Device or resource busy
13361847f8eSopenharmony_ci   * @throws { BusinessError } 13900015 - File exists
13461847f8eSopenharmony_ci   * @throws { BusinessError } 13900017 - No such device
13561847f8eSopenharmony_ci   * @throws { BusinessError } 13900018 - Not a directory
13661847f8eSopenharmony_ci   * @throws { BusinessError } 13900019 - Is a directory
13761847f8eSopenharmony_ci   * @throws { BusinessError } 13900020 - Invalid argument
13861847f8eSopenharmony_ci   * @throws { BusinessError } 13900022 - Too many open files
13961847f8eSopenharmony_ci   * @throws { BusinessError } 13900023 - Text file busy
14061847f8eSopenharmony_ci   * @throws { BusinessError } 13900024 - File too large
14161847f8eSopenharmony_ci   * @throws { BusinessError } 13900025 - No space left on device
14261847f8eSopenharmony_ci   * @throws { BusinessError } 13900027 - Read-only file system
14361847f8eSopenharmony_ci   * @throws { BusinessError } 13900029 - Resource deadlock would occur
14461847f8eSopenharmony_ci   * @throws { BusinessError } 13900030 - File name too long
14561847f8eSopenharmony_ci   * @throws { BusinessError } 13900033 - Too many symbolic links encountered
14661847f8eSopenharmony_ci   * @throws { BusinessError } 13900034 - Operation would block
14761847f8eSopenharmony_ci   * @throws { BusinessError } 13900038 - Value too large for defined data type
14861847f8eSopenharmony_ci   * @throws { BusinessError } 13900041 - Quota exceeded
14961847f8eSopenharmony_ci   * @throws { BusinessError } 13900042 - Unknown error
15061847f8eSopenharmony_ci   * @throws { BusinessError } 14300001 - IPC error
15161847f8eSopenharmony_ci   * @throws { BusinessError } 14300002 - Invalid uri
15261847f8eSopenharmony_ci   * @throws { BusinessError } 14300003 - Fail to get fileextension info
15361847f8eSopenharmony_ci   * @throws { BusinessError } 14300004 - Get wrong result
15461847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
15561847f8eSopenharmony_ci   * @systemapi
15661847f8eSopenharmony_ci   * @StageModelOnly
15761847f8eSopenharmony_ci   * @since 9
15861847f8eSopenharmony_ci   */
15961847f8eSopenharmony_ci  function createFileAccessHelper(context: Context): FileAccessHelper;
16061847f8eSopenharmony_ci
16161847f8eSopenharmony_ci  /**
16261847f8eSopenharmony_ci   * Obtains the fileAccessHelper that connects some specified fileaccess servers in the system.
16361847f8eSopenharmony_ci   *
16461847f8eSopenharmony_ci   * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
16561847f8eSopenharmony_ci   * @param { Context } context Indicates the application context.
16661847f8eSopenharmony_ci   * @param { Array<Want> } wants Represents the connected data provider.
16761847f8eSopenharmony_ci   * @returns { FileAccessHelper } Returns the fileAccessHelper.
16861847f8eSopenharmony_ci   * @throws { BusinessError } 13900001 - Operation not permitted
16961847f8eSopenharmony_ci   * @throws { BusinessError } 13900002 - No such file or directory
17061847f8eSopenharmony_ci   * @throws { BusinessError } 13900004 - Interrupted system call
17161847f8eSopenharmony_ci   * @throws { BusinessError } 13900006 - No such device or address
17261847f8eSopenharmony_ci   * @throws { BusinessError } 13900008 - Bad file descriptor
17361847f8eSopenharmony_ci   * @throws { BusinessError } 13900011 - Out of memory
17461847f8eSopenharmony_ci   * @throws { BusinessError } 13900012 - Permission denied
17561847f8eSopenharmony_ci   * @throws { BusinessError } 13900013 - Bad address
17661847f8eSopenharmony_ci   * @throws { BusinessError } 13900014 - Device or resource busy
17761847f8eSopenharmony_ci   * @throws { BusinessError } 13900015 - File exists
17861847f8eSopenharmony_ci   * @throws { BusinessError } 13900017 - No such device
17961847f8eSopenharmony_ci   * @throws { BusinessError } 13900018 - Not a directory
18061847f8eSopenharmony_ci   * @throws { BusinessError } 13900019 - Is a directory
18161847f8eSopenharmony_ci   * @throws { BusinessError } 13900020 - Invalid argument
18261847f8eSopenharmony_ci   * @throws { BusinessError } 13900022 - Too many open files
18361847f8eSopenharmony_ci   * @throws { BusinessError } 13900023 - Text file busy
18461847f8eSopenharmony_ci   * @throws { BusinessError } 13900024 - File too large
18561847f8eSopenharmony_ci   * @throws { BusinessError } 13900025 - No space left on device
18661847f8eSopenharmony_ci   * @throws { BusinessError } 13900027 - Read-only file system
18761847f8eSopenharmony_ci   * @throws { BusinessError } 13900029 - Resource deadlock would occur
18861847f8eSopenharmony_ci   * @throws { BusinessError } 13900030 - File name too long
18961847f8eSopenharmony_ci   * @throws { BusinessError } 13900033 - Too many symbolic links encountered
19061847f8eSopenharmony_ci   * @throws { BusinessError } 13900034 - Operation would block
19161847f8eSopenharmony_ci   * @throws { BusinessError } 13900038 - Value too large for defined data type
19261847f8eSopenharmony_ci   * @throws { BusinessError } 13900041 - Quota exceeded
19361847f8eSopenharmony_ci   * @throws { BusinessError } 13900042 - Unknown error
19461847f8eSopenharmony_ci   * @throws { BusinessError } 14300001 - IPC error
19561847f8eSopenharmony_ci   * @throws { BusinessError } 14300002 - Invalid uri
19661847f8eSopenharmony_ci   * @throws { BusinessError } 14300003 - Fail to get fileextension info
19761847f8eSopenharmony_ci   * @throws { BusinessError } 14300004 - Get wrong result
19861847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
19961847f8eSopenharmony_ci   * @systemapi
20061847f8eSopenharmony_ci   * @StageModelOnly
20161847f8eSopenharmony_ci   * @since 9
20261847f8eSopenharmony_ci   */
20361847f8eSopenharmony_ci  function createFileAccessHelper(context: Context, wants: Array<Want>): FileAccessHelper;
20461847f8eSopenharmony_ci
20561847f8eSopenharmony_ci  /**
20661847f8eSopenharmony_ci   * File Object
20761847f8eSopenharmony_ci   *
20861847f8eSopenharmony_ci   * @interface FileInfo
20961847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
21061847f8eSopenharmony_ci   * @systemapi
21161847f8eSopenharmony_ci   * @StageModelOnly
21261847f8eSopenharmony_ci   * @since 9
21361847f8eSopenharmony_ci   */
21461847f8eSopenharmony_ci  interface FileInfo {
21561847f8eSopenharmony_ci    /**
21661847f8eSopenharmony_ci     * Indicates the path of the file.
21761847f8eSopenharmony_ci     *
21861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
21961847f8eSopenharmony_ci     * @type { string }
22061847f8eSopenharmony_ci     * @readonly
22161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
22261847f8eSopenharmony_ci     * @systemapi
22361847f8eSopenharmony_ci     * @StageModelOnly
22461847f8eSopenharmony_ci     * @since 9
22561847f8eSopenharmony_ci     */
22661847f8eSopenharmony_ci    uri: string;
22761847f8eSopenharmony_ci    /**
22861847f8eSopenharmony_ci     * Indicates the relativePath of the file.
22961847f8eSopenharmony_ci     *
23061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
23161847f8eSopenharmony_ci     * @type { string }
23261847f8eSopenharmony_ci     * @readonly
23361847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
23461847f8eSopenharmony_ci     * @systemapi
23561847f8eSopenharmony_ci     * @StageModelOnly
23661847f8eSopenharmony_ci     * @since 10
23761847f8eSopenharmony_ci     */
23861847f8eSopenharmony_ci    relativePath: string;
23961847f8eSopenharmony_ci    /**
24061847f8eSopenharmony_ci     * Indicates the name of the file.
24161847f8eSopenharmony_ci     *
24261847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
24361847f8eSopenharmony_ci     * @type { string }
24461847f8eSopenharmony_ci     * @readonly
24561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
24661847f8eSopenharmony_ci     * @systemapi
24761847f8eSopenharmony_ci     * @StageModelOnly
24861847f8eSopenharmony_ci     * @since 9
24961847f8eSopenharmony_ci     */
25061847f8eSopenharmony_ci    fileName: string;
25161847f8eSopenharmony_ci    /**
25261847f8eSopenharmony_ci     * Indicates the mode of the file.
25361847f8eSopenharmony_ci     *
25461847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
25561847f8eSopenharmony_ci     * @type { number }
25661847f8eSopenharmony_ci     * @readonly
25761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
25861847f8eSopenharmony_ci     * @systemapi
25961847f8eSopenharmony_ci     * @StageModelOnly
26061847f8eSopenharmony_ci     * @since 9
26161847f8eSopenharmony_ci     */
26261847f8eSopenharmony_ci    mode: number;
26361847f8eSopenharmony_ci    /**
26461847f8eSopenharmony_ci     * Indicates the size of the file.
26561847f8eSopenharmony_ci     *
26661847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
26761847f8eSopenharmony_ci     * @type { number }
26861847f8eSopenharmony_ci     * @readonly
26961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
27061847f8eSopenharmony_ci     * @systemapi
27161847f8eSopenharmony_ci     * @StageModelOnly
27261847f8eSopenharmony_ci     * @since 9
27361847f8eSopenharmony_ci     */
27461847f8eSopenharmony_ci    size: number;
27561847f8eSopenharmony_ci    /**
27661847f8eSopenharmony_ci     * Indicates the mtime of the file.
27761847f8eSopenharmony_ci     *
27861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
27961847f8eSopenharmony_ci     * @type { number }
28061847f8eSopenharmony_ci     * @readonly
28161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
28261847f8eSopenharmony_ci     * @systemapi
28361847f8eSopenharmony_ci     * @StageModelOnly
28461847f8eSopenharmony_ci     * @since 9
28561847f8eSopenharmony_ci     */
28661847f8eSopenharmony_ci    mtime: number;
28761847f8eSopenharmony_ci    /**
28861847f8eSopenharmony_ci     * Indicates the mimeType of the file.
28961847f8eSopenharmony_ci     *
29061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
29161847f8eSopenharmony_ci     * @type { string }
29261847f8eSopenharmony_ci     * @readonly
29361847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
29461847f8eSopenharmony_ci     * @systemapi
29561847f8eSopenharmony_ci     * @StageModelOnly
29661847f8eSopenharmony_ci     * @since 9
29761847f8eSopenharmony_ci     */
29861847f8eSopenharmony_ci    mimeType: string;
29961847f8eSopenharmony_ci
30061847f8eSopenharmony_ci    /**
30161847f8eSopenharmony_ci     * List files in the current directory.
30261847f8eSopenharmony_ci     *
30361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
30461847f8eSopenharmony_ci     * @param { Filter } filter Indicates the filter of file.
30561847f8eSopenharmony_ci     * @returns { FileIterator } Returns the FileIterator Object.
30661847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
30761847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
30861847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
30961847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
31061847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
31161847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
31261847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
31361847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
31461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
31561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
31661847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
31761847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
31861847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
31961847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
32061847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
32161847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
32261847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
32361847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
32461847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
32561847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
32661847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
32761847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
32861847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
32961847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
33061847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
33161847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
33261847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
33361847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
33461847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
33561847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
33661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
33761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
33861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
33961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
34061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
34161847f8eSopenharmony_ci     * @systemapi
34261847f8eSopenharmony_ci     * @StageModelOnly
34361847f8eSopenharmony_ci     * @since 9
34461847f8eSopenharmony_ci     */
34561847f8eSopenharmony_ci    listFile(filter?: Filter): FileIterator;
34661847f8eSopenharmony_ci
34761847f8eSopenharmony_ci    /**
34861847f8eSopenharmony_ci     * Recursively list all files in the current directory.
34961847f8eSopenharmony_ci     *
35061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
35161847f8eSopenharmony_ci     * @param { Filter } filter Indicates the filter of file.
35261847f8eSopenharmony_ci     * @returns { FileIterator } Returns the FileIterator Object.
35361847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
35461847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
35561847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
35661847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
35761847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
35861847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
35961847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
36061847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
36161847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
36261847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
36361847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
36461847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
36561847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
36661847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
36761847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
36861847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
36961847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
37061847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
37161847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
37261847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
37361847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
37461847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
37561847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
37661847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
37761847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
37861847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
37961847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
38061847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
38161847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
38261847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
38361847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
38461847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
38561847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
38661847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
38761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
38861847f8eSopenharmony_ci     * @systemapi
38961847f8eSopenharmony_ci     * @StageModelOnly
39061847f8eSopenharmony_ci     * @since 9
39161847f8eSopenharmony_ci     */
39261847f8eSopenharmony_ci    scanFile(filter?: Filter): FileIterator;
39361847f8eSopenharmony_ci  }
39461847f8eSopenharmony_ci
39561847f8eSopenharmony_ci  /**
39661847f8eSopenharmony_ci   * FileIterator Object
39761847f8eSopenharmony_ci   *
39861847f8eSopenharmony_ci   * @interface FileIterator
39961847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
40061847f8eSopenharmony_ci   * @systemapi
40161847f8eSopenharmony_ci   * @StageModelOnly
40261847f8eSopenharmony_ci   * @since 9
40361847f8eSopenharmony_ci   */
40461847f8eSopenharmony_ci  interface FileIterator {
40561847f8eSopenharmony_ci    /**
40661847f8eSopenharmony_ci     * Get the next fileInfo.
40761847f8eSopenharmony_ci     *
40861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
40961847f8eSopenharmony_ci     * @returns { object } Returns FileInfo Object and boolean flag.
41061847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
41161847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
41261847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
41361847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
41461847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
41561847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
41661847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
41761847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
41861847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
41961847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
42061847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
42161847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
42261847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
42361847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
42461847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
42561847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
42661847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
42761847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
42861847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
42961847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
43061847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
43161847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
43261847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
43361847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
43461847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
43561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
43661847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
43761847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
43861847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
43961847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
44061847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
44161847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
44261847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
44361847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
44461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
44561847f8eSopenharmony_ci     * @systemapi
44661847f8eSopenharmony_ci     * @StageModelOnly
44761847f8eSopenharmony_ci     * @since 9
44861847f8eSopenharmony_ci     */
44961847f8eSopenharmony_ci    next(): { value: FileInfo, done: boolean };
45061847f8eSopenharmony_ci  }
45161847f8eSopenharmony_ci
45261847f8eSopenharmony_ci  /**
45361847f8eSopenharmony_ci   * Root Object
45461847f8eSopenharmony_ci   *
45561847f8eSopenharmony_ci   * @interface RootInfo
45661847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
45761847f8eSopenharmony_ci   * @systemapi
45861847f8eSopenharmony_ci   * @StageModelOnly
45961847f8eSopenharmony_ci   * @since 9
46061847f8eSopenharmony_ci   */
46161847f8eSopenharmony_ci  interface RootInfo {
46261847f8eSopenharmony_ci    /**
46361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
46461847f8eSopenharmony_ci     * @type { number }
46561847f8eSopenharmony_ci     * @readonly
46661847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
46761847f8eSopenharmony_ci     * @systemapi
46861847f8eSopenharmony_ci     * @StageModelOnly
46961847f8eSopenharmony_ci     * @since 9
47061847f8eSopenharmony_ci     */
47161847f8eSopenharmony_ci    deviceType: number;
47261847f8eSopenharmony_ci    /**
47361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
47461847f8eSopenharmony_ci     * @type { string }
47561847f8eSopenharmony_ci     * @readonly
47661847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
47761847f8eSopenharmony_ci     * @systemapi
47861847f8eSopenharmony_ci     * @StageModelOnly
47961847f8eSopenharmony_ci     * @since 9
48061847f8eSopenharmony_ci     */
48161847f8eSopenharmony_ci    uri: string;
48261847f8eSopenharmony_ci    /**
48361847f8eSopenharmony_ci     * File or directory relative path
48461847f8eSopenharmony_ci     *
48561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
48661847f8eSopenharmony_ci     * @type { string }
48761847f8eSopenharmony_ci     * @readonly
48861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
48961847f8eSopenharmony_ci     * @systemapi
49061847f8eSopenharmony_ci     * @StageModelOnly
49161847f8eSopenharmony_ci     * @since 10
49261847f8eSopenharmony_ci     */
49361847f8eSopenharmony_ci    relativePath: string;
49461847f8eSopenharmony_ci    /**
49561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
49661847f8eSopenharmony_ci     * @type { string }
49761847f8eSopenharmony_ci     * @readonly
49861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
49961847f8eSopenharmony_ci     * @systemapi
50061847f8eSopenharmony_ci     * @StageModelOnly
50161847f8eSopenharmony_ci     * @since 9
50261847f8eSopenharmony_ci     */
50361847f8eSopenharmony_ci    displayName: string;
50461847f8eSopenharmony_ci    /**
50561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
50661847f8eSopenharmony_ci     * @type { number }
50761847f8eSopenharmony_ci     * @readonly
50861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
50961847f8eSopenharmony_ci     * @systemapi
51061847f8eSopenharmony_ci     * @StageModelOnly
51161847f8eSopenharmony_ci     * @since 9
51261847f8eSopenharmony_ci     */
51361847f8eSopenharmony_ci    deviceFlags: number;
51461847f8eSopenharmony_ci
51561847f8eSopenharmony_ci    /**
51661847f8eSopenharmony_ci     * List files in the current directory.
51761847f8eSopenharmony_ci     *
51861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
51961847f8eSopenharmony_ci     * @param { Filter } filter Indicates the filter of file.
52061847f8eSopenharmony_ci     * @returns { FileIterator } Returns the FileIterator Object.
52161847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
52261847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
52361847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
52461847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
52561847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
52661847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
52761847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
52861847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
52961847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
53061847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
53161847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
53261847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
53361847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
53461847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
53561847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
53661847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
53761847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
53861847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
53961847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
54061847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
54161847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
54261847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
54361847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
54461847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
54561847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
54661847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
54761847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
54861847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
54961847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
55061847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
55161847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
55261847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
55361847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
55461847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
55561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
55661847f8eSopenharmony_ci     * @systemapi
55761847f8eSopenharmony_ci     * @StageModelOnly
55861847f8eSopenharmony_ci     * @since 9
55961847f8eSopenharmony_ci     */
56061847f8eSopenharmony_ci    listFile(filter?: Filter): FileIterator;
56161847f8eSopenharmony_ci
56261847f8eSopenharmony_ci    /**
56361847f8eSopenharmony_ci     * Recursively list all files in the current directory.
56461847f8eSopenharmony_ci     *
56561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
56661847f8eSopenharmony_ci     * @param { Filter } filter Indicates the filter of file.
56761847f8eSopenharmony_ci     * @returns { FileIterator } Returns the RootIterator Object.
56861847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
56961847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
57061847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
57161847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
57261847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
57361847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
57461847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
57561847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
57661847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
57761847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
57861847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
57961847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
58061847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
58161847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
58261847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
58361847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
58461847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
58561847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
58661847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
58761847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
58861847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
58961847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
59061847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
59161847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
59261847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
59361847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
59461847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
59561847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
59661847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
59761847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
59861847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
59961847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
60061847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
60161847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
60261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
60361847f8eSopenharmony_ci     * @systemapi
60461847f8eSopenharmony_ci     * @StageModelOnly
60561847f8eSopenharmony_ci     * @since 9
60661847f8eSopenharmony_ci     */
60761847f8eSopenharmony_ci    scanFile(filter?: Filter): FileIterator;
60861847f8eSopenharmony_ci  }
60961847f8eSopenharmony_ci
61061847f8eSopenharmony_ci  /**
61161847f8eSopenharmony_ci   * RootIterator Object
61261847f8eSopenharmony_ci   *
61361847f8eSopenharmony_ci   * @interface RootIterator
61461847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
61561847f8eSopenharmony_ci   * @systemapi
61661847f8eSopenharmony_ci   * @StageModelOnly
61761847f8eSopenharmony_ci   * @since 9
61861847f8eSopenharmony_ci   */
61961847f8eSopenharmony_ci  interface RootIterator {
62061847f8eSopenharmony_ci    /**
62161847f8eSopenharmony_ci     * Get a next RootInfo.
62261847f8eSopenharmony_ci     *
62361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
62461847f8eSopenharmony_ci     * @returns { object } Returns RootInfo Object and boolean flag.
62561847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
62661847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
62761847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
62861847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
62961847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
63061847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
63161847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
63261847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
63361847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
63461847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
63561847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
63661847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
63761847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
63861847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
63961847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
64061847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
64161847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
64261847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
64361847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
64461847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
64561847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
64661847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
64761847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
64861847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
64961847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
65061847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
65161847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
65261847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
65361847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
65461847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
65561847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
65661847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
65761847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
65861847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
65961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
66061847f8eSopenharmony_ci     * @systemapi
66161847f8eSopenharmony_ci     * @StageModelOnly
66261847f8eSopenharmony_ci     * @since 9
66361847f8eSopenharmony_ci     */
66461847f8eSopenharmony_ci    next(): { value: RootInfo, done: boolean };
66561847f8eSopenharmony_ci  }
66661847f8eSopenharmony_ci
66761847f8eSopenharmony_ci  /**
66861847f8eSopenharmony_ci   * Describes the return information of the copy operation.
66961847f8eSopenharmony_ci   *
67061847f8eSopenharmony_ci   * @interface CopyResult
67161847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
67261847f8eSopenharmony_ci   * @systemapi
67361847f8eSopenharmony_ci   * @since 10
67461847f8eSopenharmony_ci   */
67561847f8eSopenharmony_ci  interface CopyResult {
67661847f8eSopenharmony_ci    /**
67761847f8eSopenharmony_ci     * Represents the source file or directory uri to be copied
67861847f8eSopenharmony_ci     *
67961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
68061847f8eSopenharmony_ci     * @type { string }
68161847f8eSopenharmony_ci     * @readonly
68261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
68361847f8eSopenharmony_ci     * @systemapi
68461847f8eSopenharmony_ci     * @stagemodeonly
68561847f8eSopenharmony_ci     * @since 10
68661847f8eSopenharmony_ci     */
68761847f8eSopenharmony_ci    sourceUri: string;
68861847f8eSopenharmony_ci    /**
68961847f8eSopenharmony_ci     * Represents a file or directory uri in the target folder
69061847f8eSopenharmony_ci     *
69161847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
69261847f8eSopenharmony_ci     * @type { string }
69361847f8eSopenharmony_ci     * @readonly
69461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
69561847f8eSopenharmony_ci     * @systemapi
69661847f8eSopenharmony_ci     * @stagemodeonly
69761847f8eSopenharmony_ci     * @since 10
69861847f8eSopenharmony_ci     */
69961847f8eSopenharmony_ci    destUri: string;
70061847f8eSopenharmony_ci    /**
70161847f8eSopenharmony_ci     * Error code for failure to copy a file or directory.
70261847f8eSopenharmony_ci     *
70361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
70461847f8eSopenharmony_ci     * @type { number }
70561847f8eSopenharmony_ci     * @readonly
70661847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
70761847f8eSopenharmony_ci     * @systemapi
70861847f8eSopenharmony_ci     * @stagemodeonly
70961847f8eSopenharmony_ci     * @since 10
71061847f8eSopenharmony_ci     */
71161847f8eSopenharmony_ci    errCode: number;
71261847f8eSopenharmony_ci    /**
71361847f8eSopenharmony_ci     * Error message for failure to copy a file or directory.
71461847f8eSopenharmony_ci     *
71561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
71661847f8eSopenharmony_ci     * @type { string }
71761847f8eSopenharmony_ci     * @readonly
71861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
71961847f8eSopenharmony_ci     * @systemapi
72061847f8eSopenharmony_ci     * @stagemodeonly
72161847f8eSopenharmony_ci     * @since 10
72261847f8eSopenharmony_ci     */
72361847f8eSopenharmony_ci    errMsg: string;
72461847f8eSopenharmony_ci  }
72561847f8eSopenharmony_ci
72661847f8eSopenharmony_ci  /**
72761847f8eSopenharmony_ci   * OPENFLAGS represents the way to open the file.
72861847f8eSopenharmony_ci   *
72961847f8eSopenharmony_ci   * @enum { number } OPENFLAGS
73061847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
73161847f8eSopenharmony_ci   * @systemapi
73261847f8eSopenharmony_ci   * @StageModelOnly
73361847f8eSopenharmony_ci   * @since 9
73461847f8eSopenharmony_ci   */
73561847f8eSopenharmony_ci  enum OPENFLAGS {
73661847f8eSopenharmony_ci    /**
73761847f8eSopenharmony_ci     * Open the file by Read-only mode.
73861847f8eSopenharmony_ci     *
73961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
74061847f8eSopenharmony_ci     * @systemapi
74161847f8eSopenharmony_ci     * @StageModelOnly
74261847f8eSopenharmony_ci     * @since 9
74361847f8eSopenharmony_ci     */
74461847f8eSopenharmony_ci    READ = 0o0,
74561847f8eSopenharmony_ci
74661847f8eSopenharmony_ci    /**
74761847f8eSopenharmony_ci     * Open the file by Write-only mode.
74861847f8eSopenharmony_ci     *
74961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
75061847f8eSopenharmony_ci     * @systemapi
75161847f8eSopenharmony_ci     * @StageModelOnly
75261847f8eSopenharmony_ci     * @since 9
75361847f8eSopenharmony_ci     */
75461847f8eSopenharmony_ci    WRITE = 0o1,
75561847f8eSopenharmony_ci
75661847f8eSopenharmony_ci    /**
75761847f8eSopenharmony_ci     * Open the file by Write-Read mode.
75861847f8eSopenharmony_ci     *
75961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
76061847f8eSopenharmony_ci     * @systemapi
76161847f8eSopenharmony_ci     * @StageModelOnly
76261847f8eSopenharmony_ci     * @since 9
76361847f8eSopenharmony_ci     */
76461847f8eSopenharmony_ci    WRITE_READ = 0o2
76561847f8eSopenharmony_ci  }
76661847f8eSopenharmony_ci
76761847f8eSopenharmony_ci  /**
76861847f8eSopenharmony_ci   * Property elements that support the file queries.
76961847f8eSopenharmony_ci   *
77061847f8eSopenharmony_ci   * @enum { string } FileKey
77161847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
77261847f8eSopenharmony_ci   * @systemapi
77361847f8eSopenharmony_ci   * @StageModelOnly
77461847f8eSopenharmony_ci   * @since 10
77561847f8eSopenharmony_ci   */
77661847f8eSopenharmony_ci  enum FileKey {
77761847f8eSopenharmony_ci    /**
77861847f8eSopenharmony_ci     * The key represents the file name.
77961847f8eSopenharmony_ci     *
78061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
78161847f8eSopenharmony_ci     * @systemapi
78261847f8eSopenharmony_ci     * @StageModelOnly
78361847f8eSopenharmony_ci     * @since 10
78461847f8eSopenharmony_ci     */
78561847f8eSopenharmony_ci    DISPLAY_NAME = 'display_name',
78661847f8eSopenharmony_ci
78761847f8eSopenharmony_ci    /**
78861847f8eSopenharmony_ci     * The key represents the date of the file creation.
78961847f8eSopenharmony_ci     *
79061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
79161847f8eSopenharmony_ci     * @systemapi
79261847f8eSopenharmony_ci     * @StageModelOnly
79361847f8eSopenharmony_ci     * @since 10
79461847f8eSopenharmony_ci     */
79561847f8eSopenharmony_ci    DATE_ADDED = 'date_added',
79661847f8eSopenharmony_ci
79761847f8eSopenharmony_ci    /**
79861847f8eSopenharmony_ci     * The key represents the modify date of the file.
79961847f8eSopenharmony_ci     *
80061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
80161847f8eSopenharmony_ci     * @systemapi
80261847f8eSopenharmony_ci     * @StageModelOnly
80361847f8eSopenharmony_ci     * @since 10
80461847f8eSopenharmony_ci     */
80561847f8eSopenharmony_ci    DATE_MODIFIED = 'date_modified',
80661847f8eSopenharmony_ci
80761847f8eSopenharmony_ci    /**
80861847f8eSopenharmony_ci     * The key represents the relative path.
80961847f8eSopenharmony_ci     *
81061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
81161847f8eSopenharmony_ci     * @systemapi
81261847f8eSopenharmony_ci     * @StageModelOnly
81361847f8eSopenharmony_ci     * @since 10
81461847f8eSopenharmony_ci     */
81561847f8eSopenharmony_ci    RELATIVE_PATH = 'relative_path',
81661847f8eSopenharmony_ci
81761847f8eSopenharmony_ci    /**
81861847f8eSopenharmony_ci     * The key represents the file size.
81961847f8eSopenharmony_ci     *
82061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
82161847f8eSopenharmony_ci     * @systemapi
82261847f8eSopenharmony_ci     * @StageModelOnly
82361847f8eSopenharmony_ci     * @since 10
82461847f8eSopenharmony_ci     */
82561847f8eSopenharmony_ci    FILE_SIZE = 'size'
82661847f8eSopenharmony_ci  }
82761847f8eSopenharmony_ci
82861847f8eSopenharmony_ci  /**
82961847f8eSopenharmony_ci   * Describes the notifyType.
83061847f8eSopenharmony_ci   *
83161847f8eSopenharmony_ci   * @enum { number } NotifyType
83261847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
83361847f8eSopenharmony_ci   * @systemapi
83461847f8eSopenharmony_ci   * @StageModelOnly
83561847f8eSopenharmony_ci   * @since 10
83661847f8eSopenharmony_ci   */
83761847f8eSopenharmony_ci  enum NotifyType {
83861847f8eSopenharmony_ci    /**
83961847f8eSopenharmony_ci     * Type for add notification
84061847f8eSopenharmony_ci     *
84161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
84261847f8eSopenharmony_ci     * @systemapi
84361847f8eSopenharmony_ci     * @StageModelOnly
84461847f8eSopenharmony_ci     * @since 10
84561847f8eSopenharmony_ci     */
84661847f8eSopenharmony_ci    NOTIFY_ADD,
84761847f8eSopenharmony_ci
84861847f8eSopenharmony_ci    /**
84961847f8eSopenharmony_ci     * Type for delete notification
85061847f8eSopenharmony_ci     *
85161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
85261847f8eSopenharmony_ci     * @systemapi
85361847f8eSopenharmony_ci     * @StageModelOnly
85461847f8eSopenharmony_ci     * @since 10
85561847f8eSopenharmony_ci     */
85661847f8eSopenharmony_ci    NOTIFY_DELETE,
85761847f8eSopenharmony_ci
85861847f8eSopenharmony_ci    /**
85961847f8eSopenharmony_ci     * The file was moved into the monitored directory.
86061847f8eSopenharmony_ci     *
86161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
86261847f8eSopenharmony_ci     * @systemapi
86361847f8eSopenharmony_ci     * @StageModelOnly
86461847f8eSopenharmony_ci     * @since 10
86561847f8eSopenharmony_ci     */
86661847f8eSopenharmony_ci    NOTIFY_MOVED_TO,
86761847f8eSopenharmony_ci
86861847f8eSopenharmony_ci    /**
86961847f8eSopenharmony_ci     * The file in the monitored directory was moved.
87061847f8eSopenharmony_ci     *
87161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
87261847f8eSopenharmony_ci     * @systemapi
87361847f8eSopenharmony_ci     * @StageModelOnly
87461847f8eSopenharmony_ci     * @since 10
87561847f8eSopenharmony_ci     */
87661847f8eSopenharmony_ci    NOTIFY_MOVED_FROM,
87761847f8eSopenharmony_ci
87861847f8eSopenharmony_ci    /**
87961847f8eSopenharmony_ci     * The monitored file or directory was moved.
88061847f8eSopenharmony_ci     *
88161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
88261847f8eSopenharmony_ci     * @systemapi
88361847f8eSopenharmony_ci     * @StageModelOnly
88461847f8eSopenharmony_ci     * @since 10
88561847f8eSopenharmony_ci     */
88661847f8eSopenharmony_ci    NOTIFY_MOVE_SELF,
88761847f8eSopenharmony_ci
88861847f8eSopenharmony_ci    /**
88961847f8eSopenharmony_ci     * Event type of device online.
89061847f8eSopenharmony_ci     *
89161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
89261847f8eSopenharmony_ci     * @systemapi
89361847f8eSopenharmony_ci     * @StageModelOnly
89461847f8eSopenharmony_ci     * @since 11
89561847f8eSopenharmony_ci     */
89661847f8eSopenharmony_ci    NOTIFY_DEVICE_ONLINE,
89761847f8eSopenharmony_ci
89861847f8eSopenharmony_ci    /**
89961847f8eSopenharmony_ci     * Event type of device offline.
90061847f8eSopenharmony_ci     *
90161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
90261847f8eSopenharmony_ci     * @systemapi
90361847f8eSopenharmony_ci     * @StageModelOnly
90461847f8eSopenharmony_ci     * @since 11
90561847f8eSopenharmony_ci     */
90661847f8eSopenharmony_ci    NOTIFY_DEVICE_OFFLINE
90761847f8eSopenharmony_ci  }
90861847f8eSopenharmony_ci
90961847f8eSopenharmony_ci  /**
91061847f8eSopenharmony_ci   * The value of the notify callback function
91161847f8eSopenharmony_ci   *
91261847f8eSopenharmony_ci   * @interface NotifyMessage
91361847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
91461847f8eSopenharmony_ci   * @systemapi
91561847f8eSopenharmony_ci   * @StageModelOnly
91661847f8eSopenharmony_ci   * @since 10
91761847f8eSopenharmony_ci   */
91861847f8eSopenharmony_ci  interface NotifyMessage {
91961847f8eSopenharmony_ci    /**
92061847f8eSopenharmony_ci     * Indicates the change type.
92161847f8eSopenharmony_ci     *
92261847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
92361847f8eSopenharmony_ci     * @type { NotifyType }
92461847f8eSopenharmony_ci     * @readonly
92561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
92661847f8eSopenharmony_ci     * @systemapi
92761847f8eSopenharmony_ci     * @StageModelOnly
92861847f8eSopenharmony_ci     * @since 10
92961847f8eSopenharmony_ci     */
93061847f8eSopenharmony_ci    type: NotifyType;
93161847f8eSopenharmony_ci
93261847f8eSopenharmony_ci    /**
93361847f8eSopenharmony_ci     * Indicates the uris generated the change event.
93461847f8eSopenharmony_ci     *
93561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
93661847f8eSopenharmony_ci     * @type { Array<string> }
93761847f8eSopenharmony_ci     * @readonly
93861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
93961847f8eSopenharmony_ci     * @systemapi
94061847f8eSopenharmony_ci     * @StageModelOnly
94161847f8eSopenharmony_ci     * @since 10
94261847f8eSopenharmony_ci     */
94361847f8eSopenharmony_ci    uris: Array<string>;
94461847f8eSopenharmony_ci  }
94561847f8eSopenharmony_ci
94661847f8eSopenharmony_ci  /**
94761847f8eSopenharmony_ci   * Describes the return information of the move operation.
94861847f8eSopenharmony_ci   *
94961847f8eSopenharmony_ci   * @interface MoveResult
95061847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
95161847f8eSopenharmony_ci   * @systemapi
95261847f8eSopenharmony_ci   * @StageModelOnly
95361847f8eSopenharmony_ci   * @since 11
95461847f8eSopenharmony_ci   */
95561847f8eSopenharmony_ci  interface MoveResult {
95661847f8eSopenharmony_ci    /**
95761847f8eSopenharmony_ci     * Indicates the source file or directory uri to be moved.
95861847f8eSopenharmony_ci     *
95961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
96061847f8eSopenharmony_ci     * @type { string }
96161847f8eSopenharmony_ci     * @readonly
96261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
96361847f8eSopenharmony_ci     * @systemapi
96461847f8eSopenharmony_ci     * @StageModelOnly
96561847f8eSopenharmony_ci     * @since 11
96661847f8eSopenharmony_ci     */
96761847f8eSopenharmony_ci    sourceUri: string;
96861847f8eSopenharmony_ci
96961847f8eSopenharmony_ci    /**
97061847f8eSopenharmony_ci     * Indicates the file or directory uri in the destination folder.
97161847f8eSopenharmony_ci     *
97261847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
97361847f8eSopenharmony_ci     * @type { string }
97461847f8eSopenharmony_ci     * @readonly
97561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
97661847f8eSopenharmony_ci     * @systemapi
97761847f8eSopenharmony_ci     * @StageModelOnly
97861847f8eSopenharmony_ci     * @since 11
97961847f8eSopenharmony_ci     */
98061847f8eSopenharmony_ci    destUri: string;
98161847f8eSopenharmony_ci
98261847f8eSopenharmony_ci    /**
98361847f8eSopenharmony_ci     * Error code for failure to move a file or directory.
98461847f8eSopenharmony_ci     *
98561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
98661847f8eSopenharmony_ci     * @type { number }
98761847f8eSopenharmony_ci     * @readonly
98861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
98961847f8eSopenharmony_ci     * @systemapi
99061847f8eSopenharmony_ci     * @StageModelOnly
99161847f8eSopenharmony_ci     * @since 11
99261847f8eSopenharmony_ci     */
99361847f8eSopenharmony_ci    errCode: number;
99461847f8eSopenharmony_ci
99561847f8eSopenharmony_ci    /**
99661847f8eSopenharmony_ci     * Error message for failure to move a file.
99761847f8eSopenharmony_ci     *
99861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
99961847f8eSopenharmony_ci     * @type { string }
100061847f8eSopenharmony_ci     * @readonly
100161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
100261847f8eSopenharmony_ci     * @systemapi
100361847f8eSopenharmony_ci     * @StageModelOnly
100461847f8eSopenharmony_ci     * @since 11
100561847f8eSopenharmony_ci     */
100661847f8eSopenharmony_ci    errMsg: string;
100761847f8eSopenharmony_ci  }
100861847f8eSopenharmony_ci
100961847f8eSopenharmony_ci  /**
101061847f8eSopenharmony_ci   * Indicates the root uri of the device
101161847f8eSopenharmony_ci   *
101261847f8eSopenharmony_ci   * @constant
101361847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
101461847f8eSopenharmony_ci   * @systemapi
101561847f8eSopenharmony_ci   * @StageModelOnly
101661847f8eSopenharmony_ci   * @since 11
101761847f8eSopenharmony_ci   */
101861847f8eSopenharmony_ci  const DEVICES_URI = 'file://docs';
101961847f8eSopenharmony_ci
102061847f8eSopenharmony_ci  /**
102161847f8eSopenharmony_ci   * FileAccessHelper Object
102261847f8eSopenharmony_ci   *
102361847f8eSopenharmony_ci   * @interface FileAccessHelper
102461847f8eSopenharmony_ci   * @syscap SystemCapability.FileManagement.UserFileService
102561847f8eSopenharmony_ci   * @systemapi
102661847f8eSopenharmony_ci   * @since 9
102761847f8eSopenharmony_ci   */
102861847f8eSopenharmony_ci  interface FileAccessHelper {
102961847f8eSopenharmony_ci    /**
103061847f8eSopenharmony_ci     * Open a file.
103161847f8eSopenharmony_ci     *
103261847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
103361847f8eSopenharmony_ci     * @param { string } uri Indicates the path of the file to open.
103461847f8eSopenharmony_ci     * @param { OPENFLAGS } flags Indicate options of opening a file. The default value is read-only.
103561847f8eSopenharmony_ci     * @returns { Promise<number> } Returns the file descriptor.
103661847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
103761847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
103861847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
103961847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
104061847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
104161847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
104261847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
104361847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
104461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
104561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
104661847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
104761847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
104861847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
104961847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
105061847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
105161847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
105261847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
105361847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
105461847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
105561847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
105661847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
105761847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
105861847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
105961847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
106061847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
106161847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
106261847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
106361847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
106461847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
106561847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
106661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
106761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
106861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
106961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
107061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
107161847f8eSopenharmony_ci     * @systemapi
107261847f8eSopenharmony_ci     * @since 9
107361847f8eSopenharmony_ci     */
107461847f8eSopenharmony_ci    openFile(uri: string, flags: OPENFLAGS): Promise<number>;
107561847f8eSopenharmony_ci
107661847f8eSopenharmony_ci    /**
107761847f8eSopenharmony_ci     * Open a file.
107861847f8eSopenharmony_ci     *
107961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
108061847f8eSopenharmony_ci     * @param { string } uri Indicates the path of the file to open.
108161847f8eSopenharmony_ci     * @param { OPENFLAGS } flags Indicate options of opening a file. The default value is read-only.
108261847f8eSopenharmony_ci     * @param { AsyncCallback<number> } callback - The callback is used to return the file descriptor.
108361847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
108461847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
108561847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
108661847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
108761847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
108861847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
108961847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
109061847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
109161847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
109261847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
109361847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
109461847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
109561847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
109661847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
109761847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
109861847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
109961847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
110061847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
110161847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
110261847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
110361847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
110461847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
110561847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
110661847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
110761847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
110861847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
110961847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
111061847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
111161847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
111261847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
111361847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
111461847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
111561847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
111661847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
111761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
111861847f8eSopenharmony_ci     * @systemapi
111961847f8eSopenharmony_ci     * @since 9
112061847f8eSopenharmony_ci     */
112161847f8eSopenharmony_ci    openFile(uri: string, flags: OPENFLAGS, callback: AsyncCallback<number>): void;
112261847f8eSopenharmony_ci
112361847f8eSopenharmony_ci    /**
112461847f8eSopenharmony_ci     * Create a file.
112561847f8eSopenharmony_ci     *
112661847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
112761847f8eSopenharmony_ci     * @param { string } uri Represents a specific parent directory.
112861847f8eSopenharmony_ci     * @param { string } displayName Indicates the new file name, and supports with suffix.
112961847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the new file's URI.
113061847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
113161847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
113261847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
113361847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
113461847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
113561847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
113661847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
113761847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
113861847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
113961847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
114061847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
114161847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
114261847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
114361847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
114461847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
114561847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
114661847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
114761847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
114861847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
114961847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
115061847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
115161847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
115261847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
115361847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
115461847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
115561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
115661847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
115761847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
115861847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
115961847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
116061847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
116161847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
116261847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
116361847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
116461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
116561847f8eSopenharmony_ci     * @systemapi
116661847f8eSopenharmony_ci     * @since 9
116761847f8eSopenharmony_ci     */
116861847f8eSopenharmony_ci    createFile(uri: string, displayName: string): Promise<string>;
116961847f8eSopenharmony_ci
117061847f8eSopenharmony_ci    /**
117161847f8eSopenharmony_ci     * Create a file.
117261847f8eSopenharmony_ci     *
117361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
117461847f8eSopenharmony_ci     * @param { string } uri Represents a specific parent directory.
117561847f8eSopenharmony_ci     * @param { string } displayName Indicates the new file name, and supports with suffix.
117661847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - The callback is used to return the new file's URI.
117761847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
117861847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
117961847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
118061847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
118161847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
118261847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
118361847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
118461847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
118561847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
118661847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
118761847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
118861847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
118961847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
119061847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
119161847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
119261847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
119361847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
119461847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
119561847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
119661847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
119761847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
119861847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
119961847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
120061847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
120161847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
120261847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
120361847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
120461847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
120561847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
120661847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
120761847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
120861847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
120961847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
121061847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
121161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
121261847f8eSopenharmony_ci     * @systemapi
121361847f8eSopenharmony_ci     * @since 9
121461847f8eSopenharmony_ci     */
121561847f8eSopenharmony_ci    createFile(uri: string, displayName: string, callback: AsyncCallback<string>): void;
121661847f8eSopenharmony_ci
121761847f8eSopenharmony_ci    /**
121861847f8eSopenharmony_ci     * Create a Directory.
121961847f8eSopenharmony_ci     *
122061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
122161847f8eSopenharmony_ci     * @param { string } parentUri Represents a specific parent directory.
122261847f8eSopenharmony_ci     * @param { string } displayName Indicates the new directory name.
122361847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the new directory's URI.
122461847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
122561847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
122661847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
122761847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
122861847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
122961847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
123061847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
123161847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
123261847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
123361847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
123461847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
123561847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
123661847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
123761847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
123861847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
123961847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
124061847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
124161847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
124261847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
124361847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
124461847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
124561847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
124661847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
124761847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
124861847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
124961847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
125061847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
125161847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
125261847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
125361847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
125461847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
125561847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
125661847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
125761847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
125861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
125961847f8eSopenharmony_ci     * @systemapi
126061847f8eSopenharmony_ci     * @since 9
126161847f8eSopenharmony_ci     */
126261847f8eSopenharmony_ci    mkDir(parentUri: string, displayName: string): Promise<string>;
126361847f8eSopenharmony_ci
126461847f8eSopenharmony_ci    /**
126561847f8eSopenharmony_ci     * Create a Directory.
126661847f8eSopenharmony_ci     *
126761847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
126861847f8eSopenharmony_ci     * @param { string } parentUri Represents a specific parent directory.
126961847f8eSopenharmony_ci     * @param { string } displayName Indicates the new directory name.
127061847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - The callback is used to return the new directory's URI.
127161847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
127261847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
127361847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
127461847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
127561847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
127661847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
127761847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
127861847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
127961847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
128061847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
128161847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
128261847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
128361847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
128461847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
128561847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
128661847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
128761847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
128861847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
128961847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
129061847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
129161847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
129261847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
129361847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
129461847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
129561847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
129661847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
129761847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
129861847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
129961847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
130061847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
130161847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
130261847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
130361847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
130461847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
130561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
130661847f8eSopenharmony_ci     * @systemapi
130761847f8eSopenharmony_ci     * @since 9
130861847f8eSopenharmony_ci     */
130961847f8eSopenharmony_ci    mkDir(parentUri: string, displayName: string, callback: AsyncCallback<string>): void;
131061847f8eSopenharmony_ci
131161847f8eSopenharmony_ci    /**
131261847f8eSopenharmony_ci     * Delete a file or delete a directory recursively.
131361847f8eSopenharmony_ci     *
131461847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
131561847f8eSopenharmony_ci     * @param { string } uri Indicates the file or directory to be deleted.
131661847f8eSopenharmony_ci     * @returns { Promise<number> }
131761847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
131861847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
131961847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
132061847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
132161847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
132261847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
132361847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
132461847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
132561847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
132661847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
132761847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
132861847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
132961847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
133061847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
133161847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
133261847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
133361847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
133461847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
133561847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
133661847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
133761847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
133861847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
133961847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
134061847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
134161847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
134261847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
134361847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
134461847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
134561847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
134661847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
134761847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
134861847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
134961847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
135061847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
135161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
135261847f8eSopenharmony_ci     * @systemapi
135361847f8eSopenharmony_ci     * @since 9
135461847f8eSopenharmony_ci     */
135561847f8eSopenharmony_ci    delete(uri: string): Promise<number>;
135661847f8eSopenharmony_ci
135761847f8eSopenharmony_ci    /**
135861847f8eSopenharmony_ci     * Delete a file or delete a directory recursively.
135961847f8eSopenharmony_ci     *
136061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
136161847f8eSopenharmony_ci     * @param { string } uri Indicates the file or directory to be deleted.
136261847f8eSopenharmony_ci     * @param { AsyncCallback<number> } callback
136361847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
136461847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
136561847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
136661847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
136761847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
136861847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
136961847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
137061847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
137161847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
137261847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
137361847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
137461847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
137561847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
137661847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
137761847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
137861847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
137961847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
138061847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
138161847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
138261847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
138361847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
138461847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
138561847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
138661847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
138761847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
138861847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
138961847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
139061847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
139161847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
139261847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
139361847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
139461847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
139561847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
139661847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
139761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
139861847f8eSopenharmony_ci     * @systemapi
139961847f8eSopenharmony_ci     * @since 9
140061847f8eSopenharmony_ci     */
140161847f8eSopenharmony_ci    delete(uri: string, callback: AsyncCallback<number>): void;
140261847f8eSopenharmony_ci
140361847f8eSopenharmony_ci    /**
140461847f8eSopenharmony_ci     * Move a file or move a directory recursively.
140561847f8eSopenharmony_ci     *
140661847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
140761847f8eSopenharmony_ci     * @param { string } sourceFile Indicates the file or directory to be moved.
140861847f8eSopenharmony_ci     * @param { string } destFile Represents the destination folder.
140961847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the generated new file or directory.
141061847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
141161847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
141261847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
141361847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
141461847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
141561847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
141661847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
141761847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
141861847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
141961847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
142061847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
142161847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
142261847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
142361847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
142461847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
142561847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
142661847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
142761847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
142861847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
142961847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
143061847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
143161847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
143261847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
143361847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
143461847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
143561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
143661847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
143761847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
143861847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
143961847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
144061847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
144161847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
144261847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
144361847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
144461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
144561847f8eSopenharmony_ci     * @systemapi
144661847f8eSopenharmony_ci     * @since 9
144761847f8eSopenharmony_ci     */
144861847f8eSopenharmony_ci    move(sourceFile: string, destFile: string): Promise<string>;
144961847f8eSopenharmony_ci
145061847f8eSopenharmony_ci    /**
145161847f8eSopenharmony_ci     * Move a file or move a directory recursively.
145261847f8eSopenharmony_ci     *
145361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
145461847f8eSopenharmony_ci     * @param { string } sourceFile Indicates the file or directory to be moved.
145561847f8eSopenharmony_ci     * @param { string } destFile Represents the destination folder.
145661847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - The callback is used to return the generated new file or directory.
145761847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
145861847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
145961847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
146061847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
146161847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
146261847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
146361847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
146461847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
146561847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
146661847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
146761847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
146861847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
146961847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
147061847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
147161847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
147261847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
147361847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
147461847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
147561847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
147661847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
147761847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
147861847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
147961847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
148061847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
148161847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
148261847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
148361847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
148461847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
148561847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
148661847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
148761847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
148861847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
148961847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
149061847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
149161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
149261847f8eSopenharmony_ci     * @systemapi
149361847f8eSopenharmony_ci     * @since 9
149461847f8eSopenharmony_ci     */
149561847f8eSopenharmony_ci    move(sourceFile: string, destFile: string, callback: AsyncCallback<string>): void;
149661847f8eSopenharmony_ci
149761847f8eSopenharmony_ci    /**
149861847f8eSopenharmony_ci     * Copy file or directory in the promise way.
149961847f8eSopenharmony_ci     *
150061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
150161847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be copied.
150261847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
150361847f8eSopenharmony_ci     * @param { boolean } force - Optional parameter that determines whether to forcibly copy files.
150461847f8eSopenharmony_ci     * @returns { Promise<Array<CopyResult>> } Returns the file information where the error occurred.
150561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
150661847f8eSopenharmony_ci     * @systemapi
150761847f8eSopenharmony_ci     * @since 10
150861847f8eSopenharmony_ci     */
150961847f8eSopenharmony_ci    copy(sourceUri: string, destUri: string, force?: boolean): Promise<Array<CopyResult>>;
151061847f8eSopenharmony_ci
151161847f8eSopenharmony_ci    /**
151261847f8eSopenharmony_ci     * Copy file or directory in the asyncCallback way.
151361847f8eSopenharmony_ci     *
151461847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
151561847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be copied.
151661847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
151761847f8eSopenharmony_ci     * @param { AsyncCallback<Array<CopyResult>> } callback - The callback is used to return the file information where the error occurred.
151861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
151961847f8eSopenharmony_ci     * @systemapi
152061847f8eSopenharmony_ci     * @since 10
152161847f8eSopenharmony_ci     */
152261847f8eSopenharmony_ci    copy(sourceUri: string, destUri: string, callback: AsyncCallback<Array<CopyResult>>): void;
152361847f8eSopenharmony_ci
152461847f8eSopenharmony_ci    /**
152561847f8eSopenharmony_ci     * Copy file or directory in the asyncCallback way.
152661847f8eSopenharmony_ci     *
152761847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
152861847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be copied.
152961847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
153061847f8eSopenharmony_ci     * @param { boolean } force - Determines whether to forcibly copy files.
153161847f8eSopenharmony_ci     * @param { AsyncCallback<Array<CopyResult>> } callback - The callback is used to return the file information where the error occurred.
153261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
153361847f8eSopenharmony_ci     * @systemapi
153461847f8eSopenharmony_ci     * @since 10
153561847f8eSopenharmony_ci     */
153661847f8eSopenharmony_ci    copy(sourceUri: string, destUri: string, force: boolean, callback: AsyncCallback<Array<CopyResult>>): void;
153761847f8eSopenharmony_ci
153861847f8eSopenharmony_ci    /**
153961847f8eSopenharmony_ci     * copy the file with the specified file name in the promise way.
154061847f8eSopenharmony_ci     *
154161847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
154261847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
154361847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination folder.
154461847f8eSopenharmony_ci     * @param { string } fileName - Represents the name of the specified file.
154561847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the generated new file uri.
154661847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken
154761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API
154861847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
154961847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
155061847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
155161847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
155261847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
155361847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
155461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
155561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
155661847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
155761847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
155861847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
155961847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
156061847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
156161847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
156261847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
156361847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
156461847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
156561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
156661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
156761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
156861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
156961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
157061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
157161847f8eSopenharmony_ci     * @systemapi
157261847f8eSopenharmony_ci     * @StageModelOnly
157361847f8eSopenharmony_ci     * @since 11
157461847f8eSopenharmony_ci     */
157561847f8eSopenharmony_ci    copyFile(sourceUri: string, destUri: string, fileName: string): Promise<string>;
157661847f8eSopenharmony_ci
157761847f8eSopenharmony_ci    /**
157861847f8eSopenharmony_ci     * copy the file with the specified file name in the asyncCallback way.
157961847f8eSopenharmony_ci     *
158061847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
158161847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
158261847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination folder.
158361847f8eSopenharmony_ci     * @param { string } fileName - Represents the name of the specified file.
158461847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - Returns the generated new file uri.
158561847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken
158661847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API
158761847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
158861847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
158961847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
159061847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
159161847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
159261847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
159361847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
159461847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
159561847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
159661847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
159761847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
159861847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
159961847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
160061847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
160161847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
160261847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
160361847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
160461847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
160561847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
160661847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
160761847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
160861847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
160961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
161061847f8eSopenharmony_ci     * @systemapi
161161847f8eSopenharmony_ci     * @StageModelOnly
161261847f8eSopenharmony_ci     * @since 11
161361847f8eSopenharmony_ci     */
161461847f8eSopenharmony_ci    copyFile(sourceUri: string, destUri: string, fileName: string, callback: AsyncCallback<string>): void;
161561847f8eSopenharmony_ci
161661847f8eSopenharmony_ci    /**
161761847f8eSopenharmony_ci     * Rename the selected file or directory.
161861847f8eSopenharmony_ci     *
161961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
162061847f8eSopenharmony_ci     * @param { string } uri Indicates the selected file or directory.
162161847f8eSopenharmony_ci     * @param { string } displayName Indicates the new directory or file name.
162261847f8eSopenharmony_ci     * @returns { Promise<string> } Returns a URI representing the new file or directory.
162361847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
162461847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
162561847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
162661847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
162761847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
162861847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
162961847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
163061847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
163161847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
163261847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
163361847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
163461847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
163561847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
163661847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
163761847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
163861847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
163961847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
164061847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
164161847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
164261847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
164361847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
164461847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
164561847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
164661847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
164761847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
164861847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
164961847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
165061847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
165161847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
165261847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
165361847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
165461847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
165561847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
165661847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
165761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
165861847f8eSopenharmony_ci     * @systemapi
165961847f8eSopenharmony_ci     * @since 9
166061847f8eSopenharmony_ci     */
166161847f8eSopenharmony_ci    rename(uri: string, displayName: string): Promise<string>;
166261847f8eSopenharmony_ci
166361847f8eSopenharmony_ci    /**
166461847f8eSopenharmony_ci     * Rename the selected file or directory.
166561847f8eSopenharmony_ci     *
166661847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
166761847f8eSopenharmony_ci     * @param { string } uri Indicates the selected file or directory.
166861847f8eSopenharmony_ci     * @param { string } displayName Indicates the new directory or file name.
166961847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - The callback is used to return a URI representing the new file or directory.
167061847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
167161847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
167261847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
167361847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
167461847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
167561847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
167661847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
167761847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
167861847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
167961847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
168061847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
168161847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
168261847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
168361847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
168461847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
168561847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
168661847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
168761847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
168861847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
168961847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
169061847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
169161847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
169261847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
169361847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
169461847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
169561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
169661847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
169761847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
169861847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
169961847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
170061847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
170161847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
170261847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
170361847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
170461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
170561847f8eSopenharmony_ci     * @systemapi
170661847f8eSopenharmony_ci     * @since 9
170761847f8eSopenharmony_ci     */
170861847f8eSopenharmony_ci    rename(uri: string, displayName: string, callback: AsyncCallback<string>): void;
170961847f8eSopenharmony_ci
171061847f8eSopenharmony_ci    /**
171161847f8eSopenharmony_ci     * Obtain the status of a file or directory.
171261847f8eSopenharmony_ci     *
171361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
171461847f8eSopenharmony_ci     * @param { string } sourceFileUri Indicates the selected file or directory.
171561847f8eSopenharmony_ci     * @returns { Promise<boolean> } Returns whether it exists.
171661847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
171761847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
171861847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
171961847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
172061847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
172161847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
172261847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
172361847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
172461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
172561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
172661847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
172761847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
172861847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
172961847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
173061847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
173161847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
173261847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
173361847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
173461847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
173561847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
173661847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
173761847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
173861847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
173961847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
174061847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
174161847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
174261847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
174361847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
174461847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
174561847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
174661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
174761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
174861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
174961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
175061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
175161847f8eSopenharmony_ci     * @systemapi
175261847f8eSopenharmony_ci     * @since 9
175361847f8eSopenharmony_ci     */
175461847f8eSopenharmony_ci    access(sourceFileUri: string): Promise<boolean>;
175561847f8eSopenharmony_ci
175661847f8eSopenharmony_ci    /**
175761847f8eSopenharmony_ci     * Obtain the status of a file or directory.
175861847f8eSopenharmony_ci     *
175961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
176061847f8eSopenharmony_ci     * @param { string } sourceFileUri Indicates the selected file or directory.
176161847f8eSopenharmony_ci     * @param { AsyncCallback<boolean> } callback - The callback is used to return whether it exists.
176261847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
176361847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
176461847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
176561847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
176661847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
176761847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
176861847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
176961847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
177061847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
177161847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
177261847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
177361847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
177461847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
177561847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
177661847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
177761847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
177861847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
177961847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
178061847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
178161847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
178261847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
178361847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
178461847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
178561847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
178661847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
178761847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
178861847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
178961847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
179061847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
179161847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
179261847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
179361847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
179461847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
179561847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
179661847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
179761847f8eSopenharmony_ci     * @systemapi
179861847f8eSopenharmony_ci     * @since 9
179961847f8eSopenharmony_ci     */
180061847f8eSopenharmony_ci    access(sourceFileUri: string, callback: AsyncCallback<boolean>): void;
180161847f8eSopenharmony_ci
180261847f8eSopenharmony_ci    /**
180361847f8eSopenharmony_ci     * Query file related information by the uri in the promise way.
180461847f8eSopenharmony_ci     *
180561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
180661847f8eSopenharmony_ci     * @param { string } uri - Indicates the selected file or directory.
180761847f8eSopenharmony_ci     * @param { string } metaJson The json string includes query property.
180861847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the json string, includes query property and value.
180961847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
181061847f8eSopenharmony_ci     * @systemapi
181161847f8eSopenharmony_ci     * @since 10
181261847f8eSopenharmony_ci     */
181361847f8eSopenharmony_ci    query(uri: string, metaJson: string): Promise<string>;
181461847f8eSopenharmony_ci
181561847f8eSopenharmony_ci    /**
181661847f8eSopenharmony_ci     * Query file related information by the uri in the asyncCallback way.
181761847f8eSopenharmony_ci     *
181861847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
181961847f8eSopenharmony_ci     * @param { string } uri - Indicates the selected file or directory.
182061847f8eSopenharmony_ci     * @param { string } metaJson The json string includes query property.
182161847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - Returns the json string, includes query property and value.
182261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
182361847f8eSopenharmony_ci     * @systemapi
182461847f8eSopenharmony_ci     * @since 10
182561847f8eSopenharmony_ci     */
182661847f8eSopenharmony_ci    query(uri: string, metaJson: string, callback: AsyncCallback<string>): void;
182761847f8eSopenharmony_ci
182861847f8eSopenharmony_ci    /**
182961847f8eSopenharmony_ci     * Get a FileInfo by the uri in the promise way.
183061847f8eSopenharmony_ci     *
183161847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
183261847f8eSopenharmony_ci     * @param { string } uri - Indicates the selected file or directory.
183361847f8eSopenharmony_ci     * @returns { Promise<FileInfo> } Returns a FileInfo.
183461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
183561847f8eSopenharmony_ci     * @systemapi
183661847f8eSopenharmony_ci     * @since 10
183761847f8eSopenharmony_ci     */
183861847f8eSopenharmony_ci    getFileInfoFromUri(uri: string): Promise<FileInfo>;
183961847f8eSopenharmony_ci
184061847f8eSopenharmony_ci    /**
184161847f8eSopenharmony_ci     * Get a FileInfo by the uri in the asyncCallback way.
184261847f8eSopenharmony_ci     *
184361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
184461847f8eSopenharmony_ci     * @param { string } uri - Indicates the selected file or directory.
184561847f8eSopenharmony_ci     * @param { AsyncCallback<FileInfo> } callback - The callback is used to return a fileinfo object.
184661847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
184761847f8eSopenharmony_ci     * @systemapi
184861847f8eSopenharmony_ci     * @since 10
184961847f8eSopenharmony_ci     */
185061847f8eSopenharmony_ci    getFileInfoFromUri(uri: string, callback: AsyncCallback<FileInfo>): void;
185161847f8eSopenharmony_ci
185261847f8eSopenharmony_ci    /**
185361847f8eSopenharmony_ci     * Get a FileInfo by the relative path in the promise way.
185461847f8eSopenharmony_ci     *
185561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
185661847f8eSopenharmony_ci     * @param { string } relativePath - Indicates the selected file or directory.
185761847f8eSopenharmony_ci     * @returns { Promise<FileInfo> } Returns a FileInfo.
185861847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
185961847f8eSopenharmony_ci     * @systemapi
186061847f8eSopenharmony_ci     * @since 10
186161847f8eSopenharmony_ci     */
186261847f8eSopenharmony_ci    getFileInfoFromRelativePath(relativePath: string): Promise<FileInfo>;
186361847f8eSopenharmony_ci
186461847f8eSopenharmony_ci    /**
186561847f8eSopenharmony_ci     * Get a FileInfo by the relative path in the asyncCallback way.
186661847f8eSopenharmony_ci     *
186761847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
186861847f8eSopenharmony_ci     * @param { string } relativePath - Indicates the selected file or directory.
186961847f8eSopenharmony_ci     * @param { AsyncCallback<FileInfo> } callback - The callback is used to return a fileinfo object.
187061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
187161847f8eSopenharmony_ci     * @systemapi
187261847f8eSopenharmony_ci     * @since 10
187361847f8eSopenharmony_ci     */
187461847f8eSopenharmony_ci    getFileInfoFromRelativePath(relativePath: string, callback: AsyncCallback<FileInfo>): void;
187561847f8eSopenharmony_ci
187661847f8eSopenharmony_ci    /**
187761847f8eSopenharmony_ci     * Get a RootIterator.
187861847f8eSopenharmony_ci     *
187961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
188061847f8eSopenharmony_ci     * @returns { Promise<RootIterator> } Returns a RootIterator.
188161847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
188261847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
188361847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
188461847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
188561847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
188661847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
188761847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
188861847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
188961847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
189061847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
189161847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
189261847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
189361847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
189461847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
189561847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
189661847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
189761847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
189861847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
189961847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
190061847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
190161847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
190261847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
190361847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
190461847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
190561847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
190661847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
190761847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
190861847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
190961847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
191061847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
191161847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
191261847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
191361847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
191461847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
191561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
191661847f8eSopenharmony_ci     * @systemapi
191761847f8eSopenharmony_ci     * @since 9
191861847f8eSopenharmony_ci     */
191961847f8eSopenharmony_ci    getRoots(): Promise<RootIterator>;
192061847f8eSopenharmony_ci
192161847f8eSopenharmony_ci    /**
192261847f8eSopenharmony_ci     * Get a RootIterator.
192361847f8eSopenharmony_ci     *
192461847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
192561847f8eSopenharmony_ci     * @param { AsyncCallback<RootIterator> } callback - The callback is used to return a RootIterator.
192661847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
192761847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
192861847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
192961847f8eSopenharmony_ci     * @throws { BusinessError } 13900006 - No such device or address
193061847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
193161847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
193261847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
193361847f8eSopenharmony_ci     * @throws { BusinessError } 13900013 - Bad address
193461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
193561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
193661847f8eSopenharmony_ci     * @throws { BusinessError } 13900017 - No such device
193761847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
193861847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
193961847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
194061847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
194161847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
194261847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
194361847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
194461847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
194561847f8eSopenharmony_ci     * @throws { BusinessError } 13900029 - Resource deadlock would occur
194661847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
194761847f8eSopenharmony_ci     * @throws { BusinessError } 13900033 - Too many symbolic links encountered
194861847f8eSopenharmony_ci     * @throws { BusinessError } 13900034 - Operation would block
194961847f8eSopenharmony_ci     * @throws { BusinessError } 13900038 - Value too large for defined data type
195061847f8eSopenharmony_ci     * @throws { BusinessError } 13900041 - Quota exceeded
195161847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
195261847f8eSopenharmony_ci     * @throws { BusinessError } 14000001 - Invalid display name
195361847f8eSopenharmony_ci     * @throws { BusinessError } 14000002 - Invalid uri
195461847f8eSopenharmony_ci     * @throws { BusinessError } 14000003 - Invalid file extension
195561847f8eSopenharmony_ci     * @throws { BusinessError } 14000004 - File has been put into trash bin
195661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
195761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
195861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
195961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
196061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
196161847f8eSopenharmony_ci     * @systemapi
196261847f8eSopenharmony_ci     * @since 9
196361847f8eSopenharmony_ci     */
196461847f8eSopenharmony_ci    getRoots(callback: AsyncCallback<RootIterator>): void;
196561847f8eSopenharmony_ci
196661847f8eSopenharmony_ci    /**
196761847f8eSopenharmony_ci     * Turn on monitor the specified uri.
196861847f8eSopenharmony_ci     *
196961847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
197061847f8eSopenharmony_ci     * @param { string } uri - Indicates the file or directory to be monitored.
197161847f8eSopenharmony_ci     * @param { boolean } notifyForDescendants - Indicates Whether to monitor changes in descendants.
197261847f8eSopenharmony_ci     * @param { Callback<NotifyMessage> } callback - The callback is used to return the notify message.
197361847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
197461847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
197561847f8eSopenharmony_ci     * @systemapi
197661847f8eSopenharmony_ci     * @since 10
197761847f8eSopenharmony_ci     */
197861847f8eSopenharmony_ci    registerObserver(uri: string, notifyForDescendants: boolean, callback: Callback<NotifyMessage>): void;
197961847f8eSopenharmony_ci
198061847f8eSopenharmony_ci    /**
198161847f8eSopenharmony_ci     * Turn off monitor the specified uri.
198261847f8eSopenharmony_ci     *
198361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
198461847f8eSopenharmony_ci     * @param { string } uri - Indicates the file or directory the file that will cancel monitored.
198561847f8eSopenharmony_ci     * @param { Callback<NotifyMessage> } callback - The object bound to the uri.
198661847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
198761847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
198861847f8eSopenharmony_ci     * @systemapi
198961847f8eSopenharmony_ci     * @since 10
199061847f8eSopenharmony_ci     */
199161847f8eSopenharmony_ci    unregisterObserver(uri: string, callback?: Callback<NotifyMessage>): void;
199261847f8eSopenharmony_ci
199361847f8eSopenharmony_ci    /**
199461847f8eSopenharmony_ci     * Move file or directory in the promise way, And return the MoveResult.
199561847f8eSopenharmony_ci     *
199661847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
199761847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
199861847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
199961847f8eSopenharmony_ci     * @param { boolean } [force] - Optional parameter that determines whether to forcibly move files.
200061847f8eSopenharmony_ci     * @returns { Promise<Array<MoveResult>> } Returns the file information where the error occurred.
200161847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
200261847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
200361847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
200461847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
200561847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
200661847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
200761847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
200861847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
200961847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
201061847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
201161847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
201261847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
201361847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
201461847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
201561847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
201661847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
201761847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
201861847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
201961847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
202061847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
202161847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
202261847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
202361847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
202461847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
202561847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
202661847f8eSopenharmony_ci     * @systemapi
202761847f8eSopenharmony_ci     * @StageModelOnly
202861847f8eSopenharmony_ci     * @since 11
202961847f8eSopenharmony_ci     */
203061847f8eSopenharmony_ci    moveItem(sourceUri: string, destUri: string, force?: boolean): Promise<Array<MoveResult>>;
203161847f8eSopenharmony_ci
203261847f8eSopenharmony_ci    /**
203361847f8eSopenharmony_ci     * Move file or directory in the asyncCallback way, and return the MoveResult.
203461847f8eSopenharmony_ci     *
203561847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
203661847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
203761847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
203861847f8eSopenharmony_ci     * @param { AsyncCallback<Array<MoveResult>> } callback - The callback is used to return the file information where the error occurred.
203961847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
204061847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
204161847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
204261847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
204361847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
204461847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
204561847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
204661847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
204761847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
204861847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
204961847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
205061847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
205161847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
205261847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
205361847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
205461847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
205561847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
205661847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
205761847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
205861847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
205961847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
206061847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
206161847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
206261847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
206361847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
206461847f8eSopenharmony_ci     * @systemapi
206561847f8eSopenharmony_ci     * @StageModelOnly
206661847f8eSopenharmony_ci     * @since 11
206761847f8eSopenharmony_ci     */
206861847f8eSopenharmony_ci    moveItem(sourceUri: string, destUri: string, callback: AsyncCallback<Array<MoveResult>>): void;
206961847f8eSopenharmony_ci
207061847f8eSopenharmony_ci    /**
207161847f8eSopenharmony_ci     * Move file or directory in the asyncCallback way, and return the MoveResult.
207261847f8eSopenharmony_ci     *
207361847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
207461847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
207561847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination directory.
207661847f8eSopenharmony_ci     * @param { boolean } force - Determines whether to forcibly move files.
207761847f8eSopenharmony_ci     * @param { AsyncCallback<Array<MoveResult>> } callback - The callback is used to return the file information where the error occurred.
207861847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
207961847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
208061847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
208161847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
208261847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
208361847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
208461847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
208561847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
208661847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
208761847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
208861847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
208961847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
209061847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
209161847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
209261847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
209361847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
209461847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
209561847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
209661847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
209761847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
209861847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
209961847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
210061847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
210161847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
210261847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
210361847f8eSopenharmony_ci     * @systemapi
210461847f8eSopenharmony_ci     * @StageModelOnly
210561847f8eSopenharmony_ci     * @since 11
210661847f8eSopenharmony_ci     */
210761847f8eSopenharmony_ci    moveItem(sourceUri: string, destUri: string, force: boolean, callback: AsyncCallback<Array<MoveResult>>): void;
210861847f8eSopenharmony_ci
210961847f8eSopenharmony_ci    /**
211061847f8eSopenharmony_ci     * Move the file with the specified file name in the promise way.
211161847f8eSopenharmony_ci     *
211261847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
211361847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
211461847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination folder.
211561847f8eSopenharmony_ci     * @param { string } fileName - Represents the name of the specified file.
211661847f8eSopenharmony_ci     * @returns { Promise<string> } Returns the generated new file uri.
211761847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
211861847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
211961847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
212061847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
212161847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
212261847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
212361847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
212461847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
212561847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
212661847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
212761847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
212861847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
212961847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
213061847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
213161847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
213261847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
213361847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
213461847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
213561847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
213661847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
213761847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
213861847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
213961847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
214061847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
214161847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
214261847f8eSopenharmony_ci     * @systemapi
214361847f8eSopenharmony_ci     * @StageModelOnly
214461847f8eSopenharmony_ci     * @since 11
214561847f8eSopenharmony_ci     */
214661847f8eSopenharmony_ci    moveFile(sourceUri: string, destUri: string, fileName: string): Promise<string>;
214761847f8eSopenharmony_ci
214861847f8eSopenharmony_ci    /**
214961847f8eSopenharmony_ci     * Move the file with the specified file name in the asyncCallback way.
215061847f8eSopenharmony_ci     *
215161847f8eSopenharmony_ci     * @permission ohos.permission.FILE_ACCESS_MANAGER
215261847f8eSopenharmony_ci     * @param { string } sourceUri - Indicates the file or directory to be moved.
215361847f8eSopenharmony_ci     * @param { string } destUri - Represents the destination folder.
215461847f8eSopenharmony_ci     * @param { string } fileName - Represents the name of the specified file.
215561847f8eSopenharmony_ci     * @param { AsyncCallback<string> } callback - The callback is used to return the generated new file uri.
215661847f8eSopenharmony_ci     * @throws { BusinessError } 201 - Permission verification failed, usually the result returned by VerifyAccessToken.
215761847f8eSopenharmony_ci     * @throws { BusinessError } 202 - Permission verification failed, application which is not a system application uses system API.
215861847f8eSopenharmony_ci     * @throws { BusinessError } 13900001 - Operation not permitted
215961847f8eSopenharmony_ci     * @throws { BusinessError } 13900002 - No such file or directory
216061847f8eSopenharmony_ci     * @throws { BusinessError } 13900004 - Interrupted system call
216161847f8eSopenharmony_ci     * @throws { BusinessError } 13900008 - Bad file descriptor
216261847f8eSopenharmony_ci     * @throws { BusinessError } 13900011 - Out of memory
216361847f8eSopenharmony_ci     * @throws { BusinessError } 13900012 - Permission denied
216461847f8eSopenharmony_ci     * @throws { BusinessError } 13900014 - Device or resource busy
216561847f8eSopenharmony_ci     * @throws { BusinessError } 13900015 - File exists
216661847f8eSopenharmony_ci     * @throws { BusinessError } 13900018 - Not a directory
216761847f8eSopenharmony_ci     * @throws { BusinessError } 13900019 - Is a directory
216861847f8eSopenharmony_ci     * @throws { BusinessError } 13900020 - Invalid argument
216961847f8eSopenharmony_ci     * @throws { BusinessError } 13900022 - Too many open files
217061847f8eSopenharmony_ci     * @throws { BusinessError } 13900023 - Text file busy
217161847f8eSopenharmony_ci     * @throws { BusinessError } 13900024 - File too large
217261847f8eSopenharmony_ci     * @throws { BusinessError } 13900025 - No space left on device
217361847f8eSopenharmony_ci     * @throws { BusinessError } 13900027 - Read-only file system
217461847f8eSopenharmony_ci     * @throws { BusinessError } 13900030 - File name too long
217561847f8eSopenharmony_ci     * @throws { BusinessError } 13900042 - Unknown error
217661847f8eSopenharmony_ci     * @throws { BusinessError } 14300001 - IPC error
217761847f8eSopenharmony_ci     * @throws { BusinessError } 14300002 - Invalid uri
217861847f8eSopenharmony_ci     * @throws { BusinessError } 14300003 - Fail to get fileextension info
217961847f8eSopenharmony_ci     * @throws { BusinessError } 14300004 - Get wrong result
218061847f8eSopenharmony_ci     * @syscap SystemCapability.FileManagement.UserFileService
218161847f8eSopenharmony_ci     * @systemapi
218261847f8eSopenharmony_ci     * @StageModelOnly
218361847f8eSopenharmony_ci     * @since 11
218461847f8eSopenharmony_ci     */
218561847f8eSopenharmony_ci    moveFile(sourceUri: string, destUri: string, fileName: string, callback: AsyncCallback<string>): void;
218661847f8eSopenharmony_ci  }
218761847f8eSopenharmony_ci}
218861847f8eSopenharmony_ci
218961847f8eSopenharmony_ciexport default fileAccess;
2190