[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/storage/docs/folders-overview [Back]  [Original]

About folders in buckets with hierarchical namespace enabled  |  Cloud Storage  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

About folders in buckets with hierarchical namespace enabled Stay organized with collections Save and categorize content based on your preferences.

This page provides information about folders in buckets with hierarchical namespace enabled.

Overview

When you create a bucket with hierarchical namespace enabled, the bucket uses a true file system structure as opposed to a standard flat namespace. Folders exist as a resource in buckets with hierarchical namespace enabled. Using folders, you can organize your objects more effectively and gain access to true directory capabilities, such as atomic folder renames and efficient metadata operations.

Folders in buckets with hierarchical namespace enabled are different from simulated folders and managed folders. Simulated folders exist in flat namespace buckets and managed folders can be applied in both flat namespace buckets and buckets with hierarchical namespace enabled. Managed folders are primarily used to grant IAM permissions to groups of objects. For more information about these other folder types, see Folder types.

You can manage folders by performing folder operations. To learn how to create, list, and delete folders, as well as get folder metadata, see Create and manage folders. To learn how to rename or move a folder, see Rename a folder.

Folder metadata

A folder's metadata contains structured information about the folder. For detailed information about folder metadata, see the Folder resource in the Cloud Storage JSON API reference documentation.

The key components of a folder metadata are as follows:

Folder operations

This section describes the operations you can perform on folders. Some operations initiate a long-running operation that you can monitor to keep track of the operation's progress and status.

Create a folder

You can explicitly create folders by using the folder creation operation. Additionally, when you create an object and specify a non-existent folder in its path, the missing parent folder is automatically created for you. For example, creating an object named dir1/foo.txt automatically creates the folder dir1/ if it doesn't already exist.

For information about folder naming, see Considerations.

List folders

You can retrieve a list of folders in your bucket by using the list folders operation. Because folders are distinct resources in buckets with hierarchical namespace enabled, this operation evaluates the true folder structure instead of simulating folders from object paths.

When listing folders, you can filter the results using parameters such as prefix, delimiter, lexicographicStart, and lexicographicEnd. For example, setting the delimiter parameter to / lets you list folders in a directory-like mode, returning only the folders that match the prefix or exist one level below it.

The list folders operation returns paginated results. A single response page can contain a maximum of 1000 folders.

Get the metadata of a folder

You can retrieve the properties of a folder by using the get folder metadata operation. This operation retrieves information about the folder resource itself, rather than the objects it contains.

This operation returns a folder's metadata, which provides structured information such as its creation timestamp, its unique identifier, and the bucket where it resides. For a detailed list of the properties returned by this operation, see Folder metadata.

Rename or move a folder

Renaming a folder and moving a folder use the same underlying operation. The operation is an atomic, metadata-only change that updates the folder's path without physically copying or deleting the underlying objects. Renaming a folder also updates the folder's path for resources within the folder, such as child folders, objects, and managed folders. This makes the operation fast and avoids object copy costs.

The folder rename operation initiates a long-running operation.

During a folder rename operation, you can read and list the folders being renamed, but you can't run write operations on them.

In the JSON API and Google Cloud CLI, the renaming and moving operations use the same URL endpoint or command. In the Google Cloud console, Rename folder and Move folder are presented as two distinct options, but both options execute the same backend operation.

Delete a folder

You can permanently delete a folder by using the delete folder operation. While folders can be created automatically during object operations, they are not automatically removed when they become empty. You must delete them explicitly.

Interactions between folders and associated managed folders

Associated managed folders are used to control access for folders in buckets with hierarchical namespace enabled. Folders and associated managed folders interact in the following ways:

For information about naming requirements for folders that have an associated managed folder, see Naming for folders.

Considerations

When creating folders, consider the following:

What's next

Try it for yourself

If you're new to Google Cloud, create an account to evaluate how Cloud Storage performs in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.

Try Cloud Storage free
Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page