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

Pull request for ERAttachment #365

Merged
merged 1 commit into from
Jan 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,24 @@ public String acl() {
}

public QueryStringAuthGenerator queryStringAuthGenerator() {
return new QueryStringAuthGenerator(accessKeyID(), secretAccessKey(), false);
String host = ERXProperties.stringForKey("er.attachment." + configurationName() + ".s3.host");
if (host == null) {
host = ERXProperties.stringForKey("er.attachment.s3.host");
}
if (host == null)
return new QueryStringAuthGenerator(accessKeyID(), secretAccessKey(), false);
else
return new QueryStringAuthGenerator(accessKeyID(), secretAccessKey(), false, host);
}

public AWSAuthConnection awsConnection() {
AWSAuthConnection conn = new AWSAuthConnection(accessKeyID(), secretAccessKey(), true);
return conn;
String host = ERXProperties.stringForKey("er.attachment." + configurationName() + ".s3.host");
if (host == null) {
host = ERXProperties.stringForKey("er.attachment.s3.host");
}
if (host == null)
return new AWSAuthConnection(accessKeyID(), secretAccessKey(), true);
else
return new AWSAuthConnection(accessKeyID(), secretAccessKey(), true, host);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ <h2>S3 Attachments</h2>

<dt>er.attachment.s3.bucket / er.attachment.[configurationName].s3.bucket</dt>
<dd>(required) The name of the bucket to store and retrieve attachments into. The bucket must already exist in your S3 account.</dd>

<dt>er.attachment.s3.host / er.attachment.[configurationName].s3.host</dt>
<dd>(optional) Defaults to s3.amazonaws.com. Use this property if your bucket is not in the default region. For example put s3-eu-west-1.amazonaws.com for EU(Ireland).</dd>

<dt>er.attachment.s3.key / er.attachment.[configurationName].s3.key</dt>
<dd>(optional) The name of the file to store in the S3 bucket. This is evaluated as a path template. The default value is "${pk}${ext}".</dd>
Expand Down