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
Bucketinterface and its implementations instead.
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>SUPPORTED_ARCHIVE_EXTENSIONSTypes of archive that BucketFS can expand automatically.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteFileNonBlocking(String pathInBucket)Delete a file from BucketFS.StringgetWritePassword()Get the write password for the bucket.voidsetUploadNecessityCheckStrategy(UploadNecessityCheckStrategy uploadNecessityCheckStrategy)Set anUploadNecessityCheckStrategy.UploadResultuploadFileNonBlocking(Path localPath, String pathInBucket)Upload a file to the bucket.voiduploadInputStreamNonBlocking(Supplier<InputStream> inputStreamSupplier, String pathInBucket)Upload the contents of an input stream to the bucket non-blocking.voiduploadStringContentNonBlocking(String content, String pathInBucket)Upload the contents of a string to the bucket.-
Methods inherited from interface com.exasol.bucketfs.ReadOnlyBucket
downloadFile, downloadFileAsString, getBucketFsName, getBucketName, getFullyQualifiedBucketName, getReadPassword, listContents, listContents, listContentsRecursively, listContentsRecursively
-
-
-
-
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 uploadedpathInBucket- path inside the bucket- Returns:
UploadResultdescribing the status of the upload- Throws:
TimeoutException- if the synchronization check takes too longBucketAccessException- if the file cannot be uploaded to the given URIFileNotFoundException- 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 writepathInBucket- path inside the bucket- Throws:
BucketAccessException- if the file cannot be uploaded to the given URITimeoutException- if synchronization takes too long
-
uploadInputStreamNonBlocking
void uploadInputStreamNonBlocking(Supplier<InputStream> inputStreamSupplier, String pathInBucket) throws BucketAccessException, TimeoutException
Upload the contents of an input stream to the bucket non-blocking.- Parameters:
inputStreamSupplier- supplier that provides the input streampathInBucket- path inside the bucket- Throws:
BucketAccessException- if the file cannot be uploaded to the given URITimeoutException- 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 anUploadNecessityCheckStrategy.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
-
-