public class StorageExample extends Object
This example demonstrates a simple/typical storage usage.
Steps needed for running the example:
gcloud auth login.mvn compilemvn exec:java -Dexec.mainClass="com.google.cloud.examples.storage.StorageExample"
-Dexec.args="[<project_id>]
list [<bucket>] |
info [<bucket> [<file>]] |
download <bucket> <path> [local_file] |
upload <local_file> <bucket> [<path>] |
delete <bucket> <path>+ |
cp <from_bucket> <from_path> <to_bucket> <to_path> |
compose <bucket> <from_path>+ <to_path> |
update_metadata <bucket> <file> [key=value]* |
sign_url <service_account_private_key_file> <service_account_email> <bucket> <path> |
add-acl domain <bucket> <path>? <domain> OWNER|READER|WRITER |
add-acl project <bucket> <path>? <projectId>:(OWNERS|EDITORS|VIEWERS) OWNER|READER|WRITER |
add-acl user <bucket> <path>? <userEmail>|allUsers|allAuthenticatedUsers OWNER|READER|WRITER |
add-acl group <bucket> <path>? <group> OWNER|READER|WRITER"
The first parameter is an optional project_id (logged-in project will be used if not
supplied). Second parameter is a Storage operation (list, delete, compose,...) and can be used to
demonstrate its usage. Any other arguments are specific to the operation. See each action's run
method for the specific Storage interaction.
| Constructor and Description |
|---|
StorageExample() |
Copyright © 2016 Google. All rights reserved.