Package net.solarnetwork.common.s3
Class S3ClientResource
java.lang.Object
org.springframework.core.io.AbstractResource
net.solarnetwork.common.s3.S3ClientResource
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class S3ClientResource
extends org.springframework.core.io.AbstractResource
implements org.springframework.core.io.Resource
Resource implementation for a remote S3 object using the
S3Client
API.- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.springframework.core.io.AbstractResource
contentLength, createRelative, exists, getFile, getFileForLastModifiedCheck, getFilename, getURI, isFile, isOpen, isReadable, lastModified, readableChannel, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
contentLength, createRelative, exists, getFile, getFilename, getURI, isFile, isOpen, isReadable, lastModified, readableChannel
-
Constructor Details
-
S3ClientResource
Constructor.- Parameters:
client- the client to useref- the object reference- Throws:
IllegalArgumentException- if eitherclientorrefare null
-
-
Method Details
-
getInputStream
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Throws:
IOException
-
getObjectReference
Get the object reference.- Returns:
- the reference, never null
-
getDescription
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-
getURL
- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Overrides:
getURLin classorg.springframework.core.io.AbstractResource- Throws:
IOException
-
hashCode
public int hashCode()Compute a hash code.This implementation returns a hash built from
SettingSpecifierProvider.getSettingUid()andS3ObjectRef.- Overrides:
hashCodein classorg.springframework.core.io.AbstractResource
-
equals
Compare for equality.This implementation compares the
SettingSpecifierProvider.getSettingUid()andS3ObjectRefvalues.- Overrides:
equalsin classorg.springframework.core.io.AbstractResource
-