Class S3Directory


  • public final class S3Directory
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      S3Directory​(com.amazonaws.services.s3.AmazonS3 s3, java.lang.String bucketName, java.lang.String rootDirectory)  
    • Constructor Detail

      • S3Directory

        public S3Directory​(com.amazonaws.services.s3.AmazonS3 s3,
                           java.lang.String bucketName,
                           java.lang.String rootDirectory)
    • Method Detail

      • withDirectory

        public S3Directory withDirectory​(java.lang.String childDirectory)
      • ensureBucket

        public void ensureBucket()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getConfig

        public java.lang.String getConfig()
      • getPath

        public java.lang.String getPath()
      • doesObjectExist

        public boolean doesObjectExist​(java.lang.String name)
      • getObject

        public com.amazonaws.services.s3.model.S3Object getObject​(java.lang.String name)
                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • getObjectMetadata

        public com.amazonaws.services.s3.model.ObjectMetadata getObjectMetadata​(java.lang.String key)
      • readObjectToBuffer

        public Buffer readObjectToBuffer​(java.lang.String name,
                                         boolean offHeap)
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • readObjectToBuffer

        public void readObjectToBuffer​(java.lang.String name,
                                       Buffer buffer)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readObject

        public byte[] readObject​(java.lang.String key)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • writeObject

        public void writeObject​(java.lang.String name,
                                byte[] data)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • putObject

        public void putObject​(java.lang.String name,
                              java.io.InputStream input)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • copyObject

        public void copyObject​(S3Directory from,
                               java.lang.String fromKey)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteObjects

        public boolean deleteObjects​(java.util.List<com.amazonaws.services.s3.model.DeleteObjectsRequest.KeyVersion> keys)
      • deleteAllObjects

        public boolean deleteAllObjects()
      • listPrefixes

        public java.util.List<java.lang.String> listPrefixes()
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • listObjects

        public java.util.List<com.amazonaws.services.s3.model.S3ObjectSummary> listObjects​(java.lang.String prefix)
                                                                                    throws java.io.IOException
        Throws:
        java.io.IOException