Class S3Directory
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.aws.S3Directory
-
public final class S3Directory extends Object
-
-
Constructor Summary
Constructors Constructor Description S3Directory(com.amazonaws.services.s3.AmazonS3 s3, String bucketName, String rootDirectory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
copyObject(S3Directory from, String fromKey)
boolean
deleteAllObjects()
boolean
deleteObjects(List<com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion> keys)
boolean
doesObjectExist(String name)
void
ensureBucket()
String
getConfig()
com.amazonaws.services.s3.model.S3Object
getObject(String name)
com.amazonaws.services.s3.model.ObjectMetadata
getObjectMetadata(String key)
String
getPath()
List<com.amazonaws.services.s3.model.S3ObjectSummary>
listObjects(String prefix)
List<String>
listPrefixes()
void
putObject(String name, InputStream input)
byte[]
readObject(String key)
Buffer
readObjectToBuffer(String name, boolean offHeap)
void
readObjectToBuffer(String name, Buffer buffer)
S3Directory
withDirectory(String childDirectory)
void
writeObject(String name, byte[] data)
-
-
-
Method Detail
-
withDirectory
public S3Directory withDirectory(String childDirectory)
-
ensureBucket
public void ensureBucket() throws IOException
- Throws:
IOException
-
getConfig
public String getConfig()
-
getPath
public String getPath()
-
doesObjectExist
public boolean doesObjectExist(String name)
-
getObject
public com.amazonaws.services.s3.model.S3Object getObject(String name) throws IOException
- Throws:
IOException
-
getObjectMetadata
public com.amazonaws.services.s3.model.ObjectMetadata getObjectMetadata(String key)
-
readObjectToBuffer
public Buffer readObjectToBuffer(String name, boolean offHeap) throws IOException
- Throws:
IOException
-
readObjectToBuffer
public void readObjectToBuffer(String name, Buffer buffer) throws IOException
- Throws:
IOException
-
readObject
public byte[] readObject(String key) throws IOException
- Throws:
IOException
-
writeObject
public void writeObject(String name, byte[] data) throws IOException
- Throws:
IOException
-
putObject
public void putObject(String name, InputStream input) throws IOException
- Throws:
IOException
-
copyObject
public void copyObject(S3Directory from, String fromKey) throws IOException
- Throws:
IOException
-
deleteObjects
public boolean deleteObjects(List<com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion> keys)
-
deleteAllObjects
public boolean deleteAllObjects()
-
listPrefixes
public List<String> listPrefixes() throws IOException
- Throws:
IOException
-
listObjects
public List<com.amazonaws.services.s3.model.S3ObjectSummary> listObjects(String prefix) throws IOException
- Throws:
IOException
-
-