Skip to content

Add the download functionality to the Spring BOOT Photo example #1933

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 42 commits into from
Jul 22, 2021
Merged

Add the download functionality to the Spring BOOT Photo example #1933

merged 42 commits into from
Jul 22, 2021

Conversation

scmacdon
Copy link
Contributor

@scmacdon scmacdon commented Jul 21, 2021

aws-doc-sdk-examples Pull Request

Thank you for making a submission to the aws-doc-sdk-examples repository. For more information about submitting pull requests to this repository, see Guidelines for contributing.

NOTE: This PR template contains three sections. Depending on the reason for your pull request, please fill out the section that applies to you and then remove the other two sections.

New SDK Code Example

The submitter has:

  • Added the default copyright notice to all files.
  • Created unit tests for all paths through the code and they all pass.
  • Run a linter against all code and implemented the resulting suggestions.
  • Added minimum usage documentation as comments in the code.
  • Had comments and strings reviewed and incorporated suggested changes.
  • Had the code reviewed and implemented the reviewer's suggested changes.

Existing Example Update

The submitter has:

  • Confirmed that the correct copyright is included in all files.
  • Major code changes have been reviewed, and the submitter has incorporated review comments.
  • Changed or added comments and strings have been reviewed, and the submitter has incorporated any and all suggested edits.

Resolve Issue

Issue #

Description of Changes

Please describe the changes you have made here.

  • I have tested my changes and created unit tests for new code paths.
  • Changes have been reviewed, and all reviewer comments have been incorporated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@irenepsmith irenepsmith self-assigned this Jul 21, 2021
Copy link
Contributor

@irenepsmith irenepsmith left a comment

Choose a reason for hiding this comment

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

A few minor changes.

@@ -0,0 +1,80 @@
# Amazon Elastic Container Service Java code examples

Copy link
Contributor

Choose a reason for hiding this comment

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

First time: Amazon Elastic Container Service (Amazon ECS)
Second time: Amazon ECS
Third and so on: ECS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is located in the first sentence.

return;
}

//load a properties file from class path, inside static method
Copy link
Contributor

Choose a reason for hiding this comment

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

load -> Load

Also a period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

//load a properties file from class path, inside static method
prop.load(input);

// Populate the data members required for all tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -410,7 +415,7 @@ The following Java code represents the **PhotoController** class that handles HT
return s3Client.ListAllObjects("scottphoto");
}

// Generate a report that analyzes photos in a given bucket
// generates a report that analyzes photos in a given bucket
Copy link
Contributor

Choose a reason for hiding this comment

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

generate -> Generate and a period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -420,18 +425,18 @@ The following Java code represents the **PhotoController** class that handles HT
// Get a list of key names in the given bucket
List myKeys = s3Client.ListBucketObjects("scottphoto");

// Create a list to store the data
List myList = new ArrayList<List>();
// Create a List to store the data
Copy link
Contributor

Choose a reason for hiding this comment

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

Period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -420,18 +425,18 @@ The following Java code represents the **PhotoController** class that handles HT
// Get a list of key names in the given bucket
Copy link
Contributor

Choose a reason for hiding this comment

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

Period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed


// Loop through each element in the List
// loop through each element in the List
int len = myKeys.size();
for (int z=0 ; z < len; z++) {

String key = (String) myKeys.get(z);
byte[] keyData = s3Client.getObjectBytes ("scottphoto", key);
//myMap.put(key, keyData);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -51,7 +58,6 @@ String getImages(HttpServletRequest request, HttpServletResponse response) {
return s3Client.ListAllObjects("scottphoto");
}


// generates a report that analyzes photos in a given bucket
Copy link
Contributor

Choose a reason for hiding this comment

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

generates -> Generates and a period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -63,7 +69,7 @@ String report(HttpServletRequest request, HttpServletResponse response) {
List myKeys = s3Client.ListBucketObjects("scottphoto");

// Create a List to store the data
Copy link
Contributor

Choose a reason for hiding this comment

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

Period!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -63,7 +69,7 @@ String report(HttpServletRequest request, HttpServletResponse response) {
List myKeys = s3Client.ListBucketObjects("scottphoto");

// Create a List to store the data
List myList = new ArrayList<List>();
List<List> myList = new ArrayList<List>();

// loop through each element in the List
Copy link
Contributor

Choose a reason for hiding this comment

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

loop -> Loop and a period at the end of the sentence.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@irenepsmith irenepsmith left a comment

Choose a reason for hiding this comment

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

LGTM -- thanks!

@irenepsmith irenepsmith merged commit 74bc078 into awsdocs:master Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants