Class S3FileSystem

    • Constructor Detail

      • S3FileSystem

        public S3FileSystem​(software.amazon.awssdk.services.s3.S3Client s3Client)
        Creates a new instance of S3FileSystem.
        Parameters:
        s3Client - s3 client object
    • Method Detail

      • fromOptions

        public static S3FileSystem fromOptions​(com.exasol.spark.common.ExasolOptions options)
        Creates a new instance of S3FileSystem from ExasolOptions options.
        Parameters:
        options - user provided options
        Returns:
        new instance of S3FileSystem
      • doesBucketExist

        public boolean doesBucketExist​(String bucketName)
        Checks if a given bucket exists.
        Parameters:
        bucketName - name of a bucket
        Returns:
        true if bucket exists, false otherwise
      • deleteBucket

        public void deleteBucket​(String bucketName)
        Deletes a given bucket.
        Parameters:
        bucketName - name of a bucket
      • deleteKeys

        public void deleteKeys​(String bucketName,
                               String bucketKey)
        For a bucket with given name: delete all contents with the specified key.
        Parameters:
        bucketName - name of a bucket
        bucketKey - bucket key value
      • listObjects

        public List<software.amazon.awssdk.services.s3.model.S3Object> listObjects​(String bucketName,
                                                                                   Optional<String> bucketKey)
        Lists objects in a given bucket with optional bucket key.
        Parameters:
        bucketName - name of a bucket
        bucketKey - optional bucket key
        Returns:
        list of objects in a bucket
      • isEmpty

        public boolean isEmpty​(String bucketName,
                               Optional<String> bucketKey)
        Checks if a given bucket with optional bucket key is empty.
        Parameters:
        bucketName - name of a bucket
        bucketKey - optional bucket key
        Returns:
        true if bucket is empty, false otherwise