Interface ReadOnlyBucket

    • Method Detail

      • getBucketFsName

        String getBucketFsName()
        Returns:
        name of the BucketFS filesystem this bucket belongs to
      • getBucketName

        String getBucketName()
        Returns:
        name of the bucket
      • getFullyQualifiedBucketName

        String getFullyQualifiedBucketName()
        Get the fully qualified name of the bucket.
        Returns:
        fully qualified name consisting of service name and bucket name
      • getReadPassword

        String getReadPassword()
        Get the read password for the bucket.
        Returns:
        read password
      • listContents

        List<String> listContents​(String path)
                           throws BucketAccessException
        List the contents of a path inside a bucket.
        Parameters:
        path - relative path from the bucket root
        Returns:
        list of file system entries
        Throws:
        BucketAccessException - if the contents are not accessible or the path is invalid
      • listContentsRecursively

        List<String> listContentsRecursively​(String path)
                                      throws BucketAccessException
        Recursively list the contents of a path inside a bucket.
        Parameters:
        path - relative path from the bucket root
        Returns:
        list of file system entries
        Throws:
        BucketAccessException - if the contents are not accessible or the path is invalid
      • downloadFile

        void downloadFile​(String pathInBucket,
                          Path localPath)
                   throws BucketAccessException
        Download a file from a bucket to a local filesystem.
        Parameters:
        pathInBucket - path of the file in BucketFS
        localPath - local path the file is downloaded to
        Throws:
        BucketAccessException - if the local file does not exist or is not accessible or if the download failed
      • downloadFileAsString

        String downloadFileAsString​(String pathInBucket)
                             throws BucketAccessException
        Download a file from a bucket into a string.
        Parameters:
        pathInBucket - path of the file in BucketFS
        Returns:
        file contents as string
        Throws:
        BucketAccessException - if the local file does not exist or is not accessible or if the download failed