public class S3Resource extends Object implements RangeAwareResource
Resource for S3 files.| Constructor and Description |
|---|
S3Resource(S3ClientCachingFactory clientFactory,
S3Profile profile,
String key) |
S3Resource(S3ClientCachingFactory clientFactory,
S3Profile profile,
String bucket,
String key) |
| Modifier and Type | Method and Description |
|---|---|
long |
contentLength() |
org.springframework.core.io.Resource |
createRelative(String relativePath) |
boolean |
exists() |
String |
getDescription() |
File |
getFile() |
String |
getFilename() |
InputStream |
getInputStream() |
InputStream |
getInputStream(long start,
long end)
Returns a range of bytes from the resource's content.
|
URI |
getURI() |
URL |
getURL() |
boolean |
isOpen() |
boolean |
isReadable() |
long |
lastModified() |
String |
toString() |
public S3Resource(S3ClientCachingFactory clientFactory, S3Profile profile, String key)
public S3Resource(S3ClientCachingFactory clientFactory, S3Profile profile, String bucket, String key)
public boolean exists()
exists in interface org.springframework.core.io.Resourcepublic boolean isReadable()
isReadable in interface org.springframework.core.io.Resourcepublic boolean isOpen()
isOpen in interface org.springframework.core.io.Resourcepublic URL getURL() throws IOException
getURL in interface org.springframework.core.io.ResourceIOExceptionpublic URI getURI() throws IOException
getURI in interface org.springframework.core.io.ResourceIOExceptionpublic File getFile() throws IOException
getFile in interface org.springframework.core.io.ResourceIOExceptionpublic long contentLength()
throws IOException
contentLength in interface org.springframework.core.io.ResourceIOExceptionpublic long lastModified()
throws IOException
lastModified in interface org.springframework.core.io.ResourceIOExceptionpublic org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
createRelative in interface org.springframework.core.io.ResourceIOExceptionpublic String getFilename()
getFilename in interface org.springframework.core.io.Resourcepublic String getDescription()
getDescription in interface org.springframework.core.io.Resourcepublic InputStream getInputStream() throws IOException
getInputStream in interface org.springframework.core.io.InputStreamSourceIOExceptionpublic InputStream getInputStream(long start, long end) throws IOException
RangeAwareResourcegetInputStream in interface RangeAwareResourcestart - the start of the rangeend - the end of the rangeIOException - if an IO error occursCopyright © 2020 CrafterCMS. All rights reserved.