1e41f4b71Sopenharmony_ci# Introduction to Core File Kit
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciCore File Kit provides capabilities for accessing and managing application files and user files. You can use the APIs provided by Core File Kit to manage, search for, and back up different types of files efficiently.
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci## Core File Kit Overview
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ciIn Core File Kit, the files are classified into the following types based on the file owner:
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci- [Application files](app-file-overview.md): files of an application, including the installation files, resource files, and cache files of the application.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci- [User files](user-file-overview.md): files of a user who has logged in to the device. User files include the user's images, videos, audio clips, and documents.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci- System files: files irrelevant to applications and users. System files include public libraries, device files, and system resource files. The system files do not need to be managed by developers and are not described in this document.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ciThe file systems can be classified into the following types based on the file storage location (location of the data source):
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci- Local file system: allows access to the files stored on a device and its external storage devices (such as USB flash drives and removable hard drives). The local file system is the most basic file system and is not described in this document.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci- [Distributed file system](distributed-fs-overview.md): allows access to files across devices, which include not only the local device and its external storage devices, but also the devices connected over a computer network.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci**Figure 1** File classification model
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci![File classification model](figures/file-classification-model.png)
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ci## When to Use
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ciYou can use Core File Kit in any of the following scenarios:
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ci- Access to and share of application files
30e41f4b71Sopenharmony_ci- Backup and restore of application data
31e41f4b71Sopenharmony_ci- Operations for selecting and saving user files
32e41f4b71Sopenharmony_ci- Cross-device file access and sharing
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ci## Available Capabilities
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci- Accessing application files, including viewing, creating, reading, writing, delete, moving, and copying an application file, and obtaining attributes of an application file.
37e41f4b71Sopenharmony_ci- Uploading application files to a network server and downloading network resource files from a network server to the local application file directory.
38e41f4b71Sopenharmony_ci- Obtaining the storage space of an application, and the total and available space of a file system.
39e41f4b71Sopenharmony_ci- Sharing application files to other applications and using the files shared by other applications.
40e41f4b71Sopenharmony_ci- Accessing the data backup and restore framework to customize data backup and restore behaviors, such as whether to allow backup and restore and specifying the data to be backed up, by modifying the configuration file.<!--Del-->
41e41f4b71Sopenharmony_ci- Triggering data backup and restore (available only for system applications).
42e41f4b71Sopenharmony_ci<!--DelEnd-->
43e41f4b71Sopenharmony_ci- Accessing and managing user files with the [user file access framework](#user-file-access-framework). For example, selecting and saving user files<!--Del--> , and develop the user file manager (only for system applications)<!--DelEnd-->.
44e41f4b71Sopenharmony_ci- Accessing and copying files across devices.
45e41f4b71Sopenharmony_ci
46e41f4b71Sopenharmony_ci## Features
47e41f4b71Sopenharmony_ci
48e41f4b71Sopenharmony_ci- Sandbox isolation:
49e41f4b71Sopenharmony_ciEach application has a dedicated [sandbox directory](app-sandbox-directory.md) in the internal storage. The sandbox directory is a collection of the [application file directory](app-sandbox-directory.md#application-file-directory-and-application-file-path) and the system files required for application running. The sandbox feature stands out with the following advantages:
50e41f4b71Sopenharmony_ci  - Isolation: The application sandbox provides a completely isolated environment to ensure secure access to application files.
51e41f4b71Sopenharmony_ci  - Security: The application sandbox defines the minimum data visible to each application, which protects application file security.
52e41f4b71Sopenharmony_ci- Application share:
53e41f4b71Sopenharmony_ciFiles can be shared between applications by uniform resource identifier (URI) or file descriptor (FD). The application share feature has the following advantages:
54e41f4b71Sopenharmony_ci  - Portability: Files can be easily shared between applications, without the need for the user to switch between different applications.
55e41f4b71Sopenharmony_ci  - High efficiency: Files can be quickly transferred between applications, which eliminates redirections and the response time.
56e41f4b71Sopenharmony_ci  - Data consistency: File share between applications ensures data integrity and consistency, preventing data corruption or loss during transmission.
57e41f4b71Sopenharmony_ci  - Security: File share between applications prevents files from being illegally obtained or tampered with. In addition, authorized file access further enhances file security.
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci## Working Principles
60e41f4b71Sopenharmony_ci
61e41f4b71Sopenharmony_ci### Application File Access Framework
62e41f4b71Sopenharmony_ci
63e41f4b71Sopenharmony_ciThe application file access framework is implemented through [ohos.file.fs](../reference/apis-core-file-kit/js-apis-file-fs.md). You do not need to care about the internal implementation. For details about the basic file operation APIs, see [Available APIs](app-file-access.md#available-apis).
64e41f4b71Sopenharmony_ci
65e41f4b71Sopenharmony_ci### User File Access Framework
66e41f4b71Sopenharmony_ci
67e41f4b71Sopenharmony_ciYou can use the user file access framework to access and manage user files. This framework leverages the ExtensionAbility of OpenHarmony to provide a set of methods and interfaces for accessing user files.
68e41f4b71Sopenharmony_ci
69e41f4b71Sopenharmony_ci**Figure 1** User file access framework 
70e41f4b71Sopenharmony_ci![User file access framework](figures/user-file-access-framework.png)
71e41f4b71Sopenharmony_ci
72e41f4b71Sopenharmony_ci- The file access client (a system application or third-party application) can access user files, for example, select a photo or save multiple documents, by starting the **FilePicker** application.
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci- **FilePicker**: allows a file access client to select and save user files without any permission. For details, see [Selecting User Files](select-user-file.md).
75e41f4b71Sopenharmony_ci
76e41f4b71Sopenharmony_ci- **FileManager**: You can also develop your own file picker or file manager application as required. <!--RP1-->File picker is a subset of file manager. For details about how to develop a file manager application, see [Developing a File Manager Application](dev-user-file-manager.md).<!--RP1End-->
77e41f4b71Sopenharmony_ci
78e41f4b71Sopenharmony_ci- The user file access framework provides the following functional modules:
79e41f4b71Sopenharmony_ci  - **File Access Helper**: provides APIs for the **FileManager** and **FilePicker** to access user files.
80e41f4b71Sopenharmony_ci  - **File Access ExtensionAbility**: implements file access via the following services:
81e41f4b71Sopenharmony_ci    - **UserFileManager**: implements management of the files on the built-in storage based on the File Access ExtensionAbility framework.
82e41f4b71Sopenharmony_ci    - **ExternalFileManager**: implements management of the files on the external storage based on the File Access ExtensionAbility framework.
83e41f4b71Sopenharmony_ci
84e41f4b71Sopenharmony_ci## Related Kits
85e41f4b71Sopenharmony_ci
86e41f4b71Sopenharmony_ciAbility Kit: The user file access framework of Core File Kit depends on the Extension capability provided by Ability Kit and is scheduled and managed by Ability Kit.
87