Skip to content

S3Template #286

@maciejwalkowiak

Description

@maciejwalkowiak

Introduce a higher level abstraction over S3Client providing Spring idiomatic way to perform common operations.

public interface S3Operations {

	String createBucket(String bucketName);

	void deleteBucket(String bucketName);

	void deleteObject(String bucketName, String key);

	void deleteObject(String s3Url);

	void store(String bucketName, String key, Object object);

	<T> T read(String bucketName, String key, Class<T> object);

	void upload(String bucketName, String key, InputStream inputStream) throws IOException;
	
	Resource download(String bucketName, String key) throws IOException;
}

public interface S3ObjectConverter {
	<T> RequestBody write(T o);
	<T> T read(InputStream is, Class<T> clazz);
}

store and read method would use under the hood S3ObjectConverter to store regular Java objects in S3 using serialization option of choice. By default we would configure Jackson2JsonS3ObjectConverter.

Metadata

Metadata

Labels

component: s3S3 integration related issuetype: enhancementSmaller enhancement in existing integration

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions