-
Notifications
You must be signed in to change notification settings - Fork 68
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
Conversation
…ed to have permissions to create a S3 Bucket
public Bucket createS3Bucket(String name) throws IOException { | ||
AWSStaticCredentialsProvider credentialsProvider = new AWSStaticCredentialsProvider(sessionCredentials()); | ||
AmazonS3 client = getAmazonS3ClientBuilder().withCredentials(credentialsProvider).build(); | ||
return client.createBucket(name); |
There was a problem hiding this comment.
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 RuntimeException
s?
I suppose it does not matter since the caller catches Throwable
, but you might want to adjust the Javadoc to make it clearer.
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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.
it is needed to have permissions to create an S3 Bucket