Skip to content
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

Allow to create the S3 bucket from the configuration page, #62

Merged
merged 5 commits into from
Jun 28, 2018

Conversation

kuisathaverat
Copy link
Contributor

it is needed to have permissions to create an S3 Bucket

@jglick jglick requested review from jglick and carlossg June 27, 2018 13:55
public Bucket createS3Bucket(String name) throws IOException {
AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(sessionCredentials());
AmazonS3 client = getAmazonS3ClientBuilder().withCredentials(credentialsProvider).build();
return client.createBucket(name);
Copy link
Member

Choose a reason for hiding this comment

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

Does this actually throw IOException in case of trouble, or RuntimeExceptions?

I suppose it does not matter since the caller catches Throwable, but you might want to adjust the Javadoc to make it clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sessionCredentials throws an IOException, createBucket throws some runtime exceptions, I have explained it on the javadoc

} catch (Throwable t){
String msg = processExceptionMessage(t);
ret = FormValidation.error(StringUtils.abbreviate(msg, 200));
LOGGER.finest(t.getMessage());
Copy link
Member

Choose a reason for hiding this comment

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

If you are going to log at sub-INFO levels, you may as well include the whole stack trace for analysis.

@kuisathaverat kuisathaverat merged commit 5de2fae into master Jun 28, 2018
@kuisathaverat kuisathaverat deleted the allow-create-s3-bucket branch June 29, 2018 15:36
@carlossg carlossg mentioned this pull request Jul 4, 2018
@jglick jglick mentioned this pull request Jul 10, 2018
@jglick jglick mentioned this pull request Mar 14, 2022
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