Skip to content

Commit 5b50c26

Browse files
committed
Version 1.4.0.
1 parent 3aedbbe commit 5b50c26

File tree

5 files changed

+59
-2
lines changed

5 files changed

+59
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to
66
[Semantic Versioning](http://semver.org/).
77

8+
## [1.4.0] - 2018-03-22
9+
* Add `setCacheControl(...)` / `getCacheControl()` and `setContentType(...)` / `getContentType()` methods in the
10+
`S3UploadConfig` class.
11+
812
## [1.3.0] - 2018-03-21
913
* Allow the `IDocumentStore` to accept an `IUploadConfig` file to pass additional configuration properties
1014
while uploading a file.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add the following dependency to you `pom.xml` file.
1616
<dependency>
1717
<groupId>org.gomoob</groupId>
1818
<artifactId>aws-s3</artifactId>
19-
<version>1.2.0</version>
19+
<version>1.4.0</version>
2020
</dependency>
2121
```
2222

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<modelVersion>4.0.0</modelVersion>
3737
<groupId>org.gomoob</groupId>
3838
<artifactId>aws-s3</artifactId>
39-
<version>1.3.0</version>
39+
<version>1.4.0</version>
4040
<packaging>jar</packaging>
4141
<name>Gomoob Java Amazon Web Services S3 library</name>
4242
<description>The Gomoob Java Amazon Web Services S3 library contains utility class to work with the Amazon S3 Java SDK.</description>

src/main/java/com/gomoob/aws/s3/documentstore/S3DocumentStore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ private IDocumentStoreFile uploadToS3(final RequestBody requestBody, final Strin
273273

274274
// Puts the file on Amazon S3
275275
PutObjectRequest putObjectRequest = PutObjectRequest.builder().bucket(this.bucket).key(prefixedKeyName)
276+
.contentType(uploadConfig.getContentType()).cacheControl(uploadConfig.getCacheControl())
276277
.metadata(uploadConfig.getMetadata()).build();
277278

278279
this.s3.putObject(putObjectRequest, requestBody);

src/main/java/com/gomoob/aws/s3/documentstore/S3UploadConfig.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,39 @@
3636
*/
3737
public class S3UploadConfig implements IUploadConfig {
3838

39+
/**
40+
* The Amazon S3 <tt>Cache-Control</tt> metadata to attach to the object to upload.
41+
*/
42+
private String cacheControl;
43+
44+
/**
45+
* The Amazon S3 <tt>Content-Type</tt> metadata to attache to the object to upload.
46+
*/
47+
private String contentType;
48+
3949
/**
4050
* The Amazon S3 metadata to attach to the object to upload.
4151
*/
4252
private Map<String, String> metadata;
4353

54+
/**
55+
* Gets the Amazon S3 <tt>Cache-Control</tt> metadata to attache to the object to upload.
56+
*
57+
* @return the Amazon S3 <tt>Cache-Control</tt> metadata to attache to the object to upload.
58+
*/
59+
public String getCacheControl() {
60+
return this.cacheControl;
61+
}
62+
63+
/**
64+
* Gets the Amazon S3 <tt>Content-Type</tt> metadata to attache to the object to upload.
65+
*
66+
* @return the Amazon S3 <tt>Content-Type</tt> metadata to attache to the object to upload.
67+
*/
68+
public String getContentType() {
69+
return this.contentType;
70+
}
71+
4472
/**
4573
* Gets the Amazon S3 metadata to attach to the object to upload.
4674
*
@@ -50,6 +78,30 @@ public Map<String, String> getMetadata() {
5078
return this.metadata;
5179
}
5280

81+
/**
82+
* Sets the Amazon S3 <tt>Cache-Control</tt> metadata to attache to the object to upload.
83+
*
84+
* @param cacheControl the Amazon S3 <tt>Cache-Control</tt> metadata to attache to the object to upload.
85+
*
86+
* @return this instance.
87+
*/
88+
public S3UploadConfig setCacheControl(final String cacheControl) {
89+
this.cacheControl = cacheControl;
90+
return this;
91+
}
92+
93+
/**
94+
* Sets the Amazon S3 <tt>Content-Type</tt> metadata to attache to the object to upload.
95+
*
96+
* @param contentType the Amazon S3 <tt>Content-Type</tt> metadata to attache to the object to upload.
97+
*
98+
* @return this instance.
99+
*/
100+
public S3UploadConfig setContentType(final String contentType) {
101+
this.contentType = contentType;
102+
return this;
103+
}
104+
53105
/**
54106
* Sets the Amazon S3 metadata to attach to the object to upload.
55107
*

0 commit comments

Comments
 (0)