1# Introduction to Core File Kit 2 3Core 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. 4 5## Core File Kit Overview 6 7In Core File Kit, the files are classified into the following types based on the file owner: 8 9- [Application files](app-file-overview.md): files of an application, including the installation files, resource files, and cache files of the application. 10 11- [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. 12 13- 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. 14 15The file systems can be classified into the following types based on the file storage location (location of the data source): 16 17- 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. 18 19- [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. 20 21**Figure 1** File classification model 22 23 24 25## When to Use 26 27You can use Core File Kit in any of the following scenarios: 28 29- Access to and share of application files 30- Backup and restore of application data 31- Operations for selecting and saving user files 32- Cross-device file access and sharing 33 34## Available Capabilities 35 36- Accessing application files, including viewing, creating, reading, writing, delete, moving, and copying an application file, and obtaining attributes of an application file. 37- Uploading application files to a network server and downloading network resource files from a network server to the local application file directory. 38- Obtaining the storage space of an application, and the total and available space of a file system. 39- Sharing application files to other applications and using the files shared by other applications. 40- 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--> 41- Triggering data backup and restore (available only for system applications). 42<!--DelEnd--> 43- 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-->. 44- Accessing and copying files across devices. 45 46## Features 47 48- Sandbox isolation: 49Each 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: 50 - Isolation: The application sandbox provides a completely isolated environment to ensure secure access to application files. 51 - Security: The application sandbox defines the minimum data visible to each application, which protects application file security. 52- Application share: 53Files can be shared between applications by uniform resource identifier (URI) or file descriptor (FD). The application share feature has the following advantages: 54 - Portability: Files can be easily shared between applications, without the need for the user to switch between different applications. 55 - High efficiency: Files can be quickly transferred between applications, which eliminates redirections and the response time. 56 - Data consistency: File share between applications ensures data integrity and consistency, preventing data corruption or loss during transmission. 57 - Security: File share between applications prevents files from being illegally obtained or tampered with. In addition, authorized file access further enhances file security. 58 59## Working Principles 60 61### Application File Access Framework 62 63The 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). 64 65### User File Access Framework 66 67You 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. 68 69**Figure 2** User file access framework 70 71 72 73- 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. 74 75- **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). 76 77- **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--> 78 79- The user file access framework provides the following functional modules: 80 - **File Access Helper**: provides APIs for the **FileManager** and **FilePicker** to access user files. 81 - **File Access ExtensionAbility**: implements file access via the following services: 82 - **UserFileManager**: implements management of the files on the built-in storage based on the File Access ExtensionAbility framework. 83 - **ExternalFileManager**: implements management of the files on the external storage based on the File Access ExtensionAbility framework. 84 85## Related Kits 86 87Ability 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. 88 89