Package io.awspring.cloud.s3
Class S3Resource
java.lang.Object
org.springframework.core.io.AbstractResource
io.awspring.cloud.s3.S3Resource
- All Implemented Interfaces:
InputStreamSource,Resource,WritableResource
Resource implementation for S3 objects.- Since:
- 3.0
- Author:
- Agim Emruli, Alain Sahli, Maciej Walkowiak, Yuki Yoshida
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Locationprotected final software.amazon.awssdk.services.s3.S3Clientprotected final S3OutputStreamProvider -
Constructor Summary
ConstructorsConstructorDescriptionS3Resource(Location location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) S3Resource(String bucket, String key, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) S3Resource(String location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) -
Method Summary
Modifier and TypeMethodDescriptionlongstatic S3Resourcecreate(String location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) createRelative(String relativePath) booleanexists()getFile()getURL()longmetadata()voidsetObjectMetadata(ObjectMetadata objectMetadata) Methods inherited from class org.springframework.core.io.AbstractResource
equals, getFileForLastModifiedCheck, getURI, hashCode, isFile, isOpen, isReadable, readableChannel, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
getURI, isFile, isOpen, isReadable, readableChannelMethods inherited from interface org.springframework.core.io.WritableResource
isWritable, writableChannel
-
Field Details
-
location
-
s3Client
protected final software.amazon.awssdk.services.s3.S3Client s3Client -
s3OutputStreamProvider
-
-
Constructor Details
-
S3Resource
public S3Resource(String location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) -
S3Resource
public S3Resource(String bucket, String key, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) -
S3Resource
public S3Resource(Location location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider)
-
-
Method Details
-
create
@Nullable public static S3Resource create(String location, software.amazon.awssdk.services.s3.S3Client s3Client, S3OutputStreamProvider s3OutputStreamProvider) -
getURL
- Specified by:
getURLin interfaceResource- Overrides:
getURLin classAbstractResource- Throws:
IOException
-
getDescription
- Specified by:
getDescriptionin interfaceResource
-
createRelative
- Specified by:
createRelativein interfaceResource- Overrides:
createRelativein classAbstractResource
-
getInputStream
- Specified by:
getInputStreamin interfaceInputStreamSource- Throws:
IOException
-
contentType
-
setObjectMetadata
-
exists
public boolean exists()- Specified by:
existsin interfaceResource- Overrides:
existsin classAbstractResource
-
contentLength
- Specified by:
contentLengthin interfaceResource- Overrides:
contentLengthin classAbstractResource- Throws:
IOException
-
lastModified
- Specified by:
lastModifiedin interfaceResource- Overrides:
lastModifiedin classAbstractResource- Throws:
IOException
-
getFile
- Specified by:
getFilein interfaceResource- Overrides:
getFilein classAbstractResource- Throws:
IOException
-
metadata
-
getOutputStream
- Specified by:
getOutputStreamin interfaceWritableResource- Throws:
IOException
-
getFilename
- Specified by:
getFilenamein interfaceResource- Overrides:
getFilenamein classAbstractResource
-
getLocation
-