
Answer-first summary for fast verification
Answer: Create an object with the name of the subdirectory ending with a trailing slash ('/') that is zero bytes in length.
In Google Cloud Storage, folders are not actual entities but are represented implicitly by object names. To simulate a directory, you can create a zero-byte object with a name ending in a trailing slash ('/'). This convention makes the directory appear in the Cloud Console and other tools. Option A correctly follows this approach. Options B and D are invalid because deleting the object removes the directory placeholder, and the Content-Type 'CLOUDSTORAGE_FOLDER' is not valid. Option C's focus on WRITER permissions is unrelated to directory creation.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
How can you automatically create an empty subdirectory in Cloud Storage for each new user when developing an application that requires user-specific file storage?
A
Create an object with the name of the subdirectory ending with a trailing slash ('/') that is zero bytes in length.
B
Create an object with the name of the subdirectory, and then immediately delete the object within that subdirectory.
C
Create an object with the name of the subdirectory that is zero bytes in length and has WRITER access control list permission.
D
Create an object with the name of the subdirectory that is zero bytes in length. Set the Content-Type metadata to CLOUDSTORAGE_FOLDER.