Skip to content

storage: add list GCS objects in Java S3 SDK #1351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 4, 2019
Merged

Conversation

frankyn
Copy link
Contributor

@frankyn frankyn commented Mar 14, 2019

Hi,

Sample to list objects in GCS using S3 SDK.

@frankyn frankyn requested a review from a team March 14, 2019 00:18
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 14, 2019
@frankyn frankyn changed the title storage: add list GCS objects in Java S3 SDK with workaround storage: add list GCS objects in Java S3 SDK Mar 14, 2019
@frankyn frankyn added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 14, 2019
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@frankyn frankyn removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Apr 2, 2019
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 2, 2019
// 1. Change the endpoint URL to use the Google Cloud Storage XML API endpoint.
// 2. Use Cloud Storage HMAC Credentials.
AmazonS3 interopClient =
AmazonS3ClientBuilder.standard()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unnecessary line break

Suggested change
AmazonS3ClientBuilder.standard()
AmazonS3ClientBuilder.standard() = AmazonS3ClientBuilder.standard()

Copy link
Contributor Author

@frankyn frankyn Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done also applied to list buckets sample.

// Explicitly clean up client resources.
interopClient.shutdown();

return objects;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New sample formats shouldn't return anything - tests should verify output via std out

Copy link
Contributor Author

@frankyn frankyn Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done also applied to list buckets sample.

@frankyn frankyn added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 3, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Apr 3, 2019
String googleAccessKeySecret) {

// String googleAccessKeyId = "GOOGTS7C7FUP3AIRVJTE2BCD";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these real keys? Maybe something like this would make it more clear they need to replace with there own:

Suggested change
// String googleAccessKeyId = "GOOGTS7C7FUP3AIRVJTE2BCD";
// String googleAccessKeyId = "your-google-access-key-id";

Copy link
Contributor Author

@frankyn frankyn Apr 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're close but not active/usable. I thought it made sense to show what they look like rather than their name.

I pulled these from cloud storage documentation.

Copy link
Contributor

@kurtisvg kurtisvg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frankyn frankyn merged commit d42ffac into master Apr 4, 2019
@frankyn frankyn deleted the s3-sdk-list-objects branch April 4, 2019 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants