Interface Bucket

    • Method Detail

      • isObjectSynchronized

        boolean isObjectSynchronized​(String pathInBucket,
                                     BucketFsMonitor.State state)
                              throws BucketAccessException
        Check if the object with the given path is marked as synchronized after a given point in time.

        The timestamp helps telling subsequent synchronizations appart.

        Parameters:
        pathInBucket - path to the object inside the bucket
        state - state after which the synchronization needs to happen.
        Returns:
        true if the object is synchronized
        Throws:
        BucketAccessException - if the object at the reference does not exist or is inaccessible
      • uploadFile

        void uploadFile​(Path localPath,
                        String pathInBucket)
                 throws BucketAccessException,
                        TimeoutException,
                        FileNotFoundException
        Upload a file to the bucket.

        Upload a file from a given local path to a URI pointing to a BucketFS bucket. If the bucket URI ends in a slash, that URI is interpreted as a directory inside the bucket and the original filename is appended.

        This call blocks until the uploaded file is synchronized in BucketFS or a timeout occurs.

        Parameters:
        pathInBucket - path inside the bucket
        localPath - path of the file to be uploaded
        Throws:
        TimeoutException - if the synchronization check takes too long
        BucketAccessException - if the file cannot be uploaded to the given URI
        FileNotFoundException - if the source file is not found