Skip to content

Commit 309d399

Browse files
author
Jerjou Cheng
committed
Update: no longer using service accounts.
1 parent dd10b2c commit 309d399

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

cloud-storage/xml-api/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ java-docs-samples/cloud-storage XML API Examples
33

44
Samples used in Google Cloud Storage documentation (https://developers.google.com/storage/docs/xml-api-java-samples).
55

6-
- **serviceaccount-cmdline-sample** - Uses a service account private key and client ID to generate credentials to access a specified bucket.
7-
8-
- **serviceaccount-appengine-sample** - Uses Google App Engine credentials to access a specified bucket. You must add the App Engine Service Account Name to the Permissions of the project that contains the bucket.
6+
- **cmdline-sample** - Uses a [Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials) to access a specified bucket.
7+
8+
- **serviceaccount-appengine-sample** - Uses Google App Engine credentials to access a specified bucket. You must add the App Engine Service Account Name to the Permissions of the project that contains the bucket.

cloud-storage/xml-api/serviceaccount-cmdline-sample/README.md renamed to cloud-storage/xml-api/cmdline-sample/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Using the Service Account Command Line Sample
1+
Using the Command Line Sample
22
==============================================================
33

44
Browse Online
55
--------------
66

7-
The main file is [StorageServiceAccountSample.java](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/cloud-storage/xml-api/serviceaccount-cmdline-sample/src/main/java/StorageServiceAccountSample.java).
7+
The main file is [StorageSample.java](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/cloud-storage/xml-api/cmdline-sample/src/main/java/StorageSample.java).
88

99

1010
Setup
@@ -29,7 +29,7 @@ Command-line Instructions
2929
* You may need to set your `JAVA_HOME`.
3030

3131
```bash
32-
cd java-docs-samples/cloud-storage/xml-api/serviceaccount-cmdline-sample
32+
cd java-docs-samples/cloud-storage/xml-api/cmdline-sample
3333
# Compile and run
3434
mvn compile install
3535
mvn -q exec:java -Dexec.args="your-bucket-name"
@@ -53,10 +53,10 @@ Eclipse Instructions
5353
* check on "Download Artifact Sources"
5454
* check on "Download Artifact JavaDoc"
5555

56-
* Create a new project using `cloud-storage/xml-api/serviceaccount-cmdline-sample`
56+
* Create a new project using `cloud-storage/xml-api/cmdline-sample`
5757

5858
* Create a new Java Project.
59-
* Choose the **Location** of the project to be the location of `serviceaccount-cmdline-sample`
59+
* Choose the **Location** of the project to be the location of `cmdline-sample`
6060
* Select the project and **Convert to Maven Project** to add Maven Dependencies.
6161
* Click on Run > Run configurations
6262
* Navigate to your **Java Application**'s configuration section
@@ -67,4 +67,4 @@ Eclipse Instructions
6767

6868
* Right-click on project
6969
* Run As > Java Application
70-
* If asked, type "StorageServiceAccountSample" and click OK
70+
* If asked, type "StorageSample" and click OK

cloud-storage/xml-api/serviceaccount-cmdline-sample/logging.properties renamed to cloud-storage/xml-api/cmdline-sample/logging.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Properties file which configures the operation of the JDK logging facility.
22
# The system will look for this config file to be specified as a system property:
3-
# -Djava.util.logging.config.file=${project_loc:storage-serviceccount-cmdline-sample}/logging.properties
3+
# -Djava.util.logging.config.file=${project_loc:cmdline-sample}/logging.properties
44

55
# Set up the console handler (uncomment "level" to show more fine-grained messages)
66
handlers = java.util.logging.ConsoleHandler

cloud-storage/xml-api/serviceaccount-cmdline-sample/pom.xml renamed to cloud-storage/xml-api/cmdline-sample/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</execution>
2020
</executions>
2121
<configuration>
22-
<mainClass>StorageServiceAccountSample</mainClass>
22+
<mainClass>StorageSample</mainClass>
2323
</configuration>
2424
</plugin>
2525
</plugins>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import javax.xml.transform.stream.StreamResult;
4040
import javax.xml.transform.stream.StreamSource;
4141

42-
public class StorageServiceAccountSample {
42+
public class StorageSample {
4343

4444
/** Global configuration of Google Cloud Storage OAuth 2.0 scope. */
4545
private static final String STORAGE_SCOPE =
@@ -57,7 +57,7 @@ public static void main(String[] args) {
5757
String bucketName = args[0];
5858

5959
//[START snippet]
60-
// Build a service account credential.
60+
// Build an account credential.
6161
GoogleCredential credential = GoogleCredential.getApplicationDefault()
6262
.createScoped(Collections.singleton(STORAGE_SCOPE));
6363

0 commit comments

Comments
 (0)