Interface UnsynchronizedBucket

  • All Superinterfaces:
    ReadOnlyBucket
    All Known Subinterfaces:
    Bucket
    All Known Implementing Classes:
    SyncAwareBucket, WriteEnabledBucket

    public interface UnsynchronizedBucket
    extends ReadOnlyBucket
    Interface for write access to a bucket in Bucket FS.

    Note that the methods in this interface provide no guarantee that the written objects are synchronized across the cluster when they return. If you require safe synchronization, use the Bucket interface and its implementations instead.

    • Field Detail

      • SUPPORTED_ARCHIVE_EXTENSIONS

        static final Set<String> SUPPORTED_ARCHIVE_EXTENSIONS
        Types of archive that BucketFS can expand automatically.
    • Method Detail

      • getWritePassword

        String getWritePassword()
        Get the write password for the bucket.
        Returns:
        write password.
      • uploadFileNonBlocking

        UploadResult uploadFileNonBlocking​(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 immediately returns without checking whether or not the file is actually synchronized in the in BucketFS.

        Parameters:
        localPath - path of the file to be uploaded
        pathInBucket - path inside the bucket
        Returns:
        UploadResult describing the status of the upload
        Throws:
        TimeoutException - if the synchronization check takes too long
        BucketAccessException - if the file cannot be uploaded to the given URI
        FileNotFoundException - in case the source file is not found
      • uploadStringContentNonBlocking

        void uploadStringContentNonBlocking​(String content,
                                            String pathInBucket)
                                     throws BucketAccessException,
                                            TimeoutException
        Upload the contents of a string to the bucket.

        This method is intended for writing small objects in BucketFS dynamically like for example configuration files. For large payload use uploadFileNonBlocking(Path, String) instead.

        This call immediately returns without checking whether or not the file is actually synchronized in the in BucketFS.

        Parameters:
        content - string to write
        pathInBucket - path inside the bucket
        Throws:
        BucketAccessException - if the file cannot be uploaded to the given URI
        TimeoutException - if synchronization takes too long
      • deleteFileNonBlocking

        void deleteFileNonBlocking​(String pathInBucket)
                            throws BucketAccessException
        Delete a file from BucketFS.

        Warning: If you try to upload a file shortly (less than about 30s) after you deleted it, the upload will fail with access denied.

        Parameters:
        pathInBucket - file path
        Throws:
        BucketAccessException - if delete failed
      • setUploadNecessityCheckStrategy

        void setUploadNecessityCheckStrategy​(UploadNecessityCheckStrategy uploadNecessityCheckStrategy)
        Set an UploadNecessityCheckStrategy.

        This class uses the strategy during file upload to decide if the file should really be uploaded.

        Parameters:
        uploadNecessityCheckStrategy - strategy to use from now on