폴더는 계층적 네임스페이스가 사용 설정된 버킷의 리소스로 존재합니다. 파일 시스템과 비슷한 구조로 폴더 내에서 객체를 관리할 수 있습니다. Cloud Storage는 폴더 만들기, 삭제, 이름 바꾸기, 나열은 물론 폴더 메타데이터 검색과 같은 작업을 수행할 수 있게 해주는 폴더 관리 API를 제공합니다.
폴더 메타데이터
폴더의 메타데이터에는 폴더에 대한 구조화된 정보가 포함되어 있습니다. 폴더 메타데이터에 대한 자세한 내용은 Cloud Storage JSON API 참고 문서의 Folder 리소스를 참조하세요.
폴더 메타데이터의 주요 구성요소는 다음과 같습니다.
bucket: 폴더가 있는 버킷의 이름입니다. 예를 들면 my-bucket입니다.
id: 버킷 내에서 폴더의 고유 식별자입니다. 예를 들면 hns-bucket/dir1/입니다.
kind: 리소스 유형입니다. 폴더의 경우 값이 항상 storage#folder입니다.
name: 폴더의 이름입니다. 예를 들면 dir1/입니다.
selfLink: Cloud Storage API에서 폴더를 참조하는 URL입니다.
timeCreated: 폴더가 생성된 타임스탬프입니다. 예를 들면 2023-05-05T16:32:08.878000+00:00입니다.
updated: 폴더가 최종 업데이트된 타임스탬프입니다. 예를 들면 2024-05-06T16:32:08.878000+00:00입니다.
고려사항
폴더를 만들 때 다음을 고려하세요.
객체 및 폴더 이름: 계층적 네임스페이스가 사용 설정된 버킷은 선행 및 후행 슬래시(/) 또는 연속 슬래시가 있는 항목을 포함하여 모든 유효한 객체 이름을 지원합니다. 객체 이름의 각 슬래시(/)는 폴더를 나타냅니다.
다음 표에서는 폴더 계층 구조에서 객체 이름과 해당 위치 사이의 관계 예시를 보여줍니다.
객체 이름
폴더 계층 구조에서의 위치
foo.txt
모든 버킷에는 루트 폴더가 있습니다. foo.txt 객체는 버킷의 루트 폴더 아래에 있습니다.
dir1/foo.txt
foo.txt 객체는 dir1/라는 최상위 폴더 내에 있습니다. 최상위 폴더는 루트 폴더와 구분됩니다.
dir1/
dir1/와 같이 객체 이름의 후행 슬래시는 객체가 폴더 내에 있음을 나타냅니다. 이 예시에서 객체 이름 dir1/는 상위 폴더 이름 dir1/와 동일합니다.
dir1//foo.txt
foo.txt 객체는 dir1/의 하위 폴더인 dir1//라는 두 번째 계층 폴더에 있습니다.
최대 폴더 깊이: 계층적 네임스페이스가 사용 설정된 버킷은 50단계의 최대 폴더 깊이를 지원합니다. 따라서 객체 이름에 슬래시(/)는 50개를 초과할 수 없습니다.
최대 폴더 이름 크기: 512바이트(UTF-8 인코딩)입니다.
자동 폴더 만들기: 새 객체를 만들면 객체 경로에 지정된 기존에 없던 폴더가 자동으로 생성됩니다. 예를 들어 dir1/foo.txt라는 객체를 만들면 기존에 없던 dir1/ 폴더가 자동으로 생성됩니다.
민감한 정보나 개인 식별 정보(PII): 폴더 이름은 폴더 메타데이터보다 더 광범위하게 표시됩니다. 예를 들어 폴더 이름은 URL에 표시되거나 버킷에 폴더나 객체를 나열할 때 표시됩니다. 폴더 이름에 민감한 정보나 PII를 포함하지 마세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# About folders in buckets with hierarchical namespace enabled\n\nThis page provides information about folders in buckets with\nhierarchical namespace enabled.\n\nOverview\n--------\n\nFolders exist as a resource in buckets with [hierarchical namespace](/storage/docs/hns-overview)\nenabled. You can organize objects within folders in a file system-like\nstructure. Cloud Storage provides folder management APIs that enable\noperations such as creating, deleting, renaming, and listing folders, as well as\nretrieving folder metadata.\n\nFolder metadata\n---------------\n\nA folder's metadata contains structured information about the folder. For\ndetailed information about folder metadata, see the [`Folder` resource](/storage/docs/json_api/v1/folders#resource) in\nthe Cloud Storage JSON API reference documentation.\n\nThe key components of a folder metadata are as follows:\n\n- `bucket`: The name of the bucket where the folder resides. For example, `my-bucket`.\n- `id`: A unique identifier for the folder within the bucket. For example, `hns-bucket/dir1/`.\n- `kind`: The resource type. For a folder, this value is always `storage#folder`.\n- `name`: The name of the folder. For example, `dir1/`.\n- `selfLink`: A URL that references the folder in the Cloud Storage API.\n- `timeCreated`: The timestamp when the folder was created. For example, `2023-05-05T16:32:08.878000+00:00`.\n- `updated`: The timestamp when the folder was last updated. For example, `2024-05-06T16:32:08.878000+00:00`.\n\nConsiderations\n--------------\n\nWhen creating folders, consider the following:\n\n- **Object and folder names** : Buckets with hierarchical namespace enabled,\n support all valid [object names](/storage/docs/objects#naming), including\n those with leading, trailing slashes (`/`) or consecutive slashes. Each\n forward slash (`/`) in an object name represents a folder.\n The following table shows examples of the relationship between object names\n and their corresponding location in the folder hierarchy:\n\n- **Maximum folder depth** : Buckets with hierarchical namespace enabled\n support a maximum folder depth of 50. As a result, object names cannot have\n more than 50 slashes (`/`).\n\n- **Maximum folder name size**: 512 bytes (UTF-8 encoded).\n\n- **Automatic folder creation** : Creating a new object automatically creates\n any non-existent folders specified in the object's path. For example,\n creating an object named `dir1/foo.txt` automatically creates the folder\n `dir1/` if it doesn't already exist.\n\n- **Sensitive or personally identifiable information (PII)**: Folder names are\n more broadly visible than folder metadata. For example, folder names appear\n in URLs and when listing folders or objects in a bucket. Don't include\n sensitive information or PII in folder names.\n\nWhat's next\n-----------\n\n- [Create and manage folders](/storage/docs/create-folders).\n- [Rename a folder](/storage/docs/rename-hns-folders).\n- [Optimize folder management](/storage/docs/hns-buckets-best-practices#folder-management).\n\nTry it for yourself\n-------------------\n\n\nIf you're new to Google Cloud, create an account to evaluate how\nCloud Storage performs in real-world\nscenarios. New customers also get $300 in free credits to run, test, and\ndeploy workloads.\n[Try Cloud Storage free](https://console.cloud.google.com/freetrial)"]]