애플리케이션별 데이터 저장
애플리케이션 데이터 폴더는 앱에서 구성 파일과 같은 애플리케이션별 데이터를 저장하는 데 사용할 수 있는 특수한 숨겨진 폴더입니다. 애플리케이션 데이터 폴더는 폴더에 파일을 만들려고 할 때 자동으로 생성됩니다.
사용자가 직접 상호작용해서는 안 되는 파일을 저장하는 데 이 폴더를 사용하세요. 이 폴더는 애플리케이션에서만 액세스할 수 있으며 콘텐츠는 사용자와 다른 Drive 앱에 표시되지 않습니다.
appDataFolder
의 파일은 저장소 위치 (스페이스) 간에 이동할 수 없습니다. 자세한 내용은 파일 구성을 참고하세요.
애플리케이션 데이터 폴더는 사용자가 MyDrive에서 앱을 제거할 때 삭제됩니다. 사용자는 앱의 데이터 폴더를 수동으로 삭제할 수도 있습니다.
애플리케이션 데이터 폴더 범위
애플리케이션 데이터 폴더에 액세스하려면 먼저 https://www.googleapis.com/auth/drive.appdata
범위에 대한 액세스를 요청해야 합니다. 범위 및 범위에 대한 액세스 권한을 요청하는 방법에 관한 자세한 내용은 API별 승인 및 인증 정보를 참고하세요. 특정 OAuth 2.0 범위에 관한 자세한 내용은 Google API의 OAuth 2.0 범위를 참고하세요.
애플리케이션 데이터 폴더에 파일 만들기
애플리케이션 데이터 폴더에 파일을 만들려면 파일의 parents
속성에 appDataFolder
를 지정하고 files.create
메서드를 사용하여 파일을 폴더에 업로드합니다. 다음 코드 샘플은 클라이언트 라이브러리를 사용하여 폴더에 파일을 삽입하는 방법을 보여줍니다.
폴더에 파일을 만드는 방법에 관한 자세한 내용은 폴더 만들기 및 채우기를 참고하세요.
애플리케이션 데이터 폴더에서 파일 검색
애플리케이션 데이터 폴더에서 파일을 검색하려면 spaces
필드를 appDataFolder
로 설정하고 files.list
메서드를 사용합니다. 다음 코드 샘플은 클라이언트 라이브러리를 사용하여 애플리케이션 데이터 폴더에서 파일을 검색하는 방법을 보여줍니다.
애플리케이션 데이터 폴더에서 파일 다운로드
애플리케이션 데이터 폴더에서 파일을 다운로드하려면 files.get
메서드를 사용합니다. 자세한 내용과 코드 샘플을 보려면 Blob 파일 콘텐츠 다운로드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-02-24(UTC)
[null,null,["최종 업데이트: 2025-02-24(UTC)"],[[["The application data folder is a hidden folder used by your app to store app-specific data, like configuration files, that is only accessible by your application and is automatically deleted when the app is uninstalled."],["Files in this folder do not move between storage locations and to access it, you need to request the `https://www.googleapis.com/auth/drive.appdata` scope."],["To create a file in the application data folder, specify `appDataFolder` in the `parents` property of the file within the `files.create` method."],["To search for files within the application data folder, set the `spaces` field to `appDataFolder` within the `files.list` method."]]],["The *application data folder* stores app-specific data, hidden from users and other apps, automatically created upon file creation attempts. Files within cannot be moved between storage spaces. Access requires the `https://www.googleapis.com/auth/drive.appdata` scope. To create a file, set `appDataFolder` in the file's `parents` property and use the `files.create` method. To search files, set `spaces` to `appDataFolder` and use the `files.list` method. The folder is deleted when the app is uninstalled.\n"]]