public class MinioClient extends Object
If access/secret keys are provided, all S3 operation requests are signed using AWS Signature Version 4; else they are performed anonymously.
Examples on using this library are available here.
Use MinioClient.builder() to create S3 client.
// Create client with anonymous access.
MinioClient minioClient = MinioClient.builder().endpoint("https://play.min.io").build();
// Create client with credentials.
MinioClient minioClient =
MinioClient.builder()
.endpoint("https://play.min.io")
.credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
MinioClient.Builder |
| Constructor and Description |
|---|
MinioClient(okhttp3.HttpUrl url)
Deprecated.
|
MinioClient(okhttp3.HttpUrl url,
String accessKey,
String secretKey)
Deprecated.
|
MinioClient(String endpoint)
Deprecated.
|
MinioClient(String endpoint,
Integer port,
String accessKey,
String secretKey,
String region,
Boolean secure,
okhttp3.OkHttpClient httpClient)
Deprecated.
|
MinioClient(String endpoint,
int port,
String accessKey,
String secretKey)
Deprecated.
|
MinioClient(String endpoint,
int port,
String accessKey,
String secretKey,
boolean secure)
Deprecated.
|
MinioClient(String endpoint,
int port,
String accessKey,
String secretKey,
String region,
boolean secure)
Deprecated.
|
MinioClient(String endpoint,
String accessKey,
String secretKey)
Deprecated.
|
MinioClient(String endpoint,
String accessKey,
String secretKey,
boolean secure)
Deprecated.
|
MinioClient(String endpoint,
String accessKey,
String secretKey,
String region)
Deprecated.
|
MinioClient(URL url)
Deprecated.
|
MinioClient(URL url,
String accessKey,
String secretKey)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
abortMultipartUpload(String bucketName,
String objectName,
String uploadId)
|
boolean |
bucketExists(BucketExistsArgs args)
Checks if a bucket exists.
|
boolean |
bucketExists(String bucketName)
Deprecated.
|
static MinioClient.Builder |
builder() |
protected void |
completeMultipartUpload(String bucketName,
String objectName,
String uploadId,
Part[] parts)
Deprecated.
|
protected ObjectWriteResponse |
completeMultipartUpload(String bucketName,
String region,
String objectName,
String uploadId,
Part[] parts,
com.google.common.collect.Multimap<String,String> extraHeaders,
com.google.common.collect.Multimap<String,String> extraQueryParams)
|
ObjectWriteResponse |
composeObject(ComposeObjectArgs args)
Creates an object by combining data from different source objects using server-side copy.
|
void |
composeObject(String bucketName,
String objectName,
List<ComposeSource> sources,
Map<String,String> headerMap,
ServerSideEncryption sse)
Deprecated.
|
ObjectWriteResponse |
copyObject(CopyObjectArgs args)
Creates an object by server-side copying data from another object.
|
void |
copyObject(String bucketName,
String objectName,
Map<String,String> headerMap,
ServerSideEncryption sse,
String srcBucketName,
String srcObjectName,
ServerSideEncryption srcSse,
CopyConditions copyConditions)
Deprecated.
|
protected String |
createMultipartUpload(String bucketName,
String objectName,
Map<String,String> headerMap)
Deprecated.
|
protected String |
createMultipartUpload(String bucketName,
String region,
String objectName,
com.google.common.collect.Multimap<String,String> headers,
com.google.common.collect.Multimap<String,String> extraQueryParams)
|
void |
deleteBucketEncryption(DeleteBucketEncryptionArgs args)
Deletes encryption configuration of a bucket.
|
void |
deleteBucketLifeCycle(DeleteBucketLifeCycleArgs args)
Deletes life-cycle configuration of a bucket.
|
void |
deleteBucketLifeCycle(String bucketName)
Deprecated.
|
void |
deleteBucketNotification(DeleteBucketNotificationArgs args)
Deletes notification configuration of a bucket.
|
void |
deleteBucketPolicy(DeleteBucketPolicyArgs args)
Deletes bucket policy configuration to a bucket.
|
void |
deleteBucketTags(DeleteBucketTagsArgs args)
Deletes tags of a bucket.
|
void |
deleteDefaultRetention(DeleteDefaultRetentionArgs args)
Deletes default object retention in a bucket.
|
protected DeleteResult |
deleteObjects(String bucketName,
List<DeleteObject> objectList,
boolean quiet,
boolean bypassGovernanceMode)
|
void |
deleteObjectTags(DeleteObjectTagsArgs args)
Deletes tags of an object.
|
void |
disableAccelerateEndpoint()
Disables accelerate endpoint for Amazon S3 endpoint.
|
void |
disableDualStackEndpoint()
Disables dual-stack endpoint for Amazon S3 endpoint.
|
void |
disableObjectLegalHold(DisableObjectLegalHoldArgs args)
Disables legal hold on an object.
|
void |
disableObjectLegalHold(String bucketName,
String objectName,
String versionId)
Deprecated.
|
void |
disableVersioning(DisableVersioningArgs args)
Disables object versioning feature in a bucket.
|
void |
disableVersioning(String bucketName)
Deprecated.
|
void |
disableVirtualStyleEndpoint()
Disables virtual-style endpoint.
|
void |
downloadObject(DownloadObjectArgs args)
Downloads data of a SSE-C encrypted object to file.
|
void |
enableAccelerateEndpoint()
Enables accelerate endpoint for Amazon S3 endpoint.
|
void |
enableDualStackEndpoint()
Enables dual-stack endpoint for Amazon S3 endpoint.
|
void |
enableObjectLegalHold(EnableObjectLegalHoldArgs args)
Enables legal hold on an object.
|
void |
enableObjectLegalHold(String bucketName,
String objectName,
String versionId)
Deprecated.
|
void |
enableVersioning(EnableVersioningArgs args)
Enables object versioning feature in a bucket.
|
void |
enableVersioning(String bucketName)
Deprecated.
|
void |
enableVirtualStyleEndpoint()
Enables virtual-style endpoint.
|
SseConfiguration |
getBucketEncryption(GetBucketEncryptionArgs args)
Gets encryption configuration of a bucket.
|
String |
getBucketLifeCycle(GetBucketLifeCycleArgs args)
Gets life-cycle configuration of a bucket.
|
String |
getBucketLifeCycle(String bucketName)
Deprecated.
|
NotificationConfiguration |
getBucketNotification(GetBucketNotificationArgs args)
Gets notification configuration of a bucket.
|
NotificationConfiguration |
getBucketNotification(String bucketName)
Deprecated.
|
String |
getBucketPolicy(GetBucketPolicyArgs args)
Gets bucket policy configuration of a bucket.
|
String |
getBucketPolicy(String bucketName)
Deprecated.
|
Tags |
getBucketTags(GetBucketTagsArgs args)
Gets tags of a bucket.
|
ObjectLockConfiguration |
getDefaultRetention(GetDefaultRetentionArgs args)
Gets default object retention in a bucket.
|
ObjectLockConfiguration |
getDefaultRetention(String bucketName)
Deprecated.
|
InputStream |
getObject(GetObjectArgs args)
Gets data from offset to length of a SSE-C encrypted object.
|
InputStream |
getObject(String bucketName,
String objectName)
Deprecated.
|
InputStream |
getObject(String bucketName,
String objectName,
long offset)
Deprecated.
|
InputStream |
getObject(String bucketName,
String objectName,
long offset,
Long length)
Deprecated.
|
InputStream |
getObject(String bucketName,
String objectName,
Long offset,
Long length,
ServerSideEncryptionCustomerKey ssec)
Deprecated.
|
InputStream |
getObject(String bucketName,
String objectName,
ServerSideEncryptionCustomerKey ssec)
Deprecated.
|
void |
getObject(String bucketName,
String objectName,
ServerSideEncryptionCustomerKey ssec,
String fileName)
Deprecated.
|
void |
getObject(String bucketName,
String objectName,
String fileName)
Deprecated.
|
Retention |
getObjectRetention(GetObjectRetentionArgs args)
Gets retention configuration of an object.
|
Retention |
getObjectRetention(String bucketName,
String objectName,
String versionId)
Deprecated.
|
Tags |
getObjectTags(GetObjectTagsArgs args)
Gets tags of an object.
|
String |
getObjectUrl(String bucketName,
String objectName)
Gets URL of an object useful when this object has public read access.
|
String |
getPresignedObjectUrl(GetPresignedObjectUrlArgs args)
Gets presigned URL of an object for HTTP method, expiry time and custom request parameters.
|
String |
getPresignedObjectUrl(Method method,
String bucketName,
String objectName,
Integer expires,
Map<String,String> reqParams)
Deprecated.
|
void |
ignoreCertCheck()
Ignores check on server certificate for HTTPS connection.
|
boolean |
isObjectLegalHoldEnabled(IsObjectLegalHoldEnabledArgs args)
Returns true if legal hold is enabled on an object.
|
boolean |
isObjectLegalHoldEnabled(String bucketName,
String objectName,
String versionId)
Deprecated.
|
boolean |
isVersioningEnabled(IsVersioningEnabledArgs args)
Returns true if versioning is enabled on the bucket.
|
List<Bucket> |
listBuckets()
Lists bucket information of all buckets.
|
CloseableIterator<Result<NotificationRecords>> |
listenBucketNotification(ListenBucketNotificationArgs args)
Listens events of object prefix and suffix of a bucket.
|
CloseableIterator<Result<NotificationRecords>> |
listenBucketNotification(String bucketName,
String prefix,
String suffix,
String[] events)
Deprecated.
|
Iterable<Result<Upload>> |
listIncompleteUploads(ListIncompleteUploadsArgs args)
Lists incomplete object upload information of a bucket for prefix recursively.
|
Iterable<Result<Upload>> |
listIncompleteUploads(String bucketName)
Deprecated.
|
Iterable<Result<Upload>> |
listIncompleteUploads(String bucketName,
String prefix)
Deprecated.
|
Iterable<Result<Upload>> |
listIncompleteUploads(String bucketName,
String prefix,
boolean recursive)
Deprecated.
|
protected ListMultipartUploadsResult |
listMultipartUploads(String bucketName,
String delimiter,
String keyMarker,
Integer maxUploads,
String prefix,
String uploadIdMarker)
|
Iterable<Result<Item>> |
listObjects(ListObjectsArgs args)
Lists objects information optionally with versions of a bucket.
|
Iterable<Result<Item>> |
listObjects(String bucketName)
Deprecated.
|
Iterable<Result<Item>> |
listObjects(String bucketName,
String prefix)
Deprecated.
|
Iterable<Result<Item>> |
listObjects(String bucketName,
String prefix,
boolean recursive)
Deprecated.
|
Iterable<Result<Item>> |
listObjects(String bucketName,
String prefix,
boolean recursive,
boolean useVersion1)
Deprecated.
|
Iterable<Result<Item>> |
listObjects(String bucketName,
String prefix,
boolean recursive,
boolean includeUserMetadata,
boolean useVersion1)
Deprecated.
|
protected ListBucketResultV1 |
listObjectsV1(String bucketName,
String region,
String delimiter,
boolean useUrlEncodingType,
String marker,
int maxKeys,
String prefix,
com.google.common.collect.Multimap<String,String> extraHeaders,
com.google.common.collect.Multimap<String,String> extraQueryParams) |
protected ListBucketResultV2 |
listObjectsV2(String bucketName,
String region,
String delimiter,
boolean useUrlEncodingType,
String startAfter,
int maxKeys,
String prefix,
String continuationToken,
boolean fetchOwner,
boolean includeUserMetadata,
com.google.common.collect.Multimap<String,String> extraHeaders,
com.google.common.collect.Multimap<String,String> extraQueryParams) |
protected ListVersionsResult |
listObjectVersions(String bucketName,
String region,
String delimiter,
boolean useUrlEncodingType,
String keyMarker,
int maxKeys,
String prefix,
String versionIdMarker,
com.google.common.collect.Multimap<String,String> extraHeaders,
com.google.common.collect.Multimap<String,String> extraQueryParams) |
protected ListPartsResult |
listParts(String bucketName,
String objectName,
Integer maxParts,
Integer partNumberMarker,
String uploadId)
Do ListParts S3
API.
|
void |
makeBucket(MakeBucketArgs args)
Creates a bucket with region and object lock.
|
void |
makeBucket(String bucketName)
Deprecated.
|
void |
makeBucket(String bucketName,
String region)
Deprecated.
|
void |
makeBucket(String bucketName,
String region,
boolean objectLock)
Deprecated.
|
String |
presignedGetObject(String bucketName,
String objectName)
Deprecated.
|
String |
presignedGetObject(String bucketName,
String objectName,
Integer expires)
Deprecated.
|
String |
presignedGetObject(String bucketName,
String objectName,
Integer expires,
Map<String,String> reqParams)
Deprecated.
|
Map<String,String> |
presignedPostPolicy(PostPolicy policy)
Gets form-data of
PostPolicy of an object to upload its data using POST method. |
String |
presignedPutObject(String bucketName,
String objectName)
Deprecated.
|
String |
presignedPutObject(String bucketName,
String objectName,
Integer expires)
Deprecated.
|
ObjectWriteResponse |
putObject(PutObjectArgs args)
Uploads data from a stream to an object.
|
void |
putObject(String bucketName,
String objectName,
InputStream stream,
PutObjectOptions options)
Deprecated.
|
protected String |
putObject(String bucketName,
String objectName,
Object data,
int length,
Map<String,String> headerMap)
Deprecated.
|
protected ObjectWriteResponse |
putObject(String bucketName,
String region,
String objectName,
Object data,
int length,
com.google.common.collect.Multimap<String,String> headers,
com.google.common.collect.Multimap<String,String> extraQueryParams)
Do PutObject S3
API.
|
void |
putObject(String bucketName,
String objectName,
String filename,
PutObjectOptions options)
Deprecated.
|
void |
removeAllBucketNotification(String bucketName)
Deprecated.
|
void |
removeBucket(RemoveBucketArgs args)
Removes an empty bucket using arguments
|
void |
removeBucket(String bucketName)
Deprecated.
|
void |
removeIncompleteUpload(RemoveIncompleteUploadArgs args)
Removes incomplete uploads of an object.
|
void |
removeIncompleteUpload(String bucketName,
String objectName)
Deprecated.
|
void |
removeObject(RemoveObjectArgs args)
Removes an object.
|
void |
removeObject(String bucketName,
String objectName)
Deprecated.
|
Iterable<Result<DeleteError>> |
removeObjects(RemoveObjectsArgs args)
Removes multiple objects lazily.
|
Iterable<Result<DeleteError>> |
removeObjects(String bucketName,
Iterable<String> objectNames)
Deprecated.
|
SelectResponseStream |
selectObjectContent(SelectObjectContentArgs args)
Selects content of an object by SQL expression.
|
SelectResponseStream |
selectObjectContent(String bucketName,
String objectName,
String sqlExpression,
InputSerialization is,
OutputSerialization os,
boolean requestProgress,
Long scanStartRange,
Long scanEndRange,
ServerSideEncryptionCustomerKey ssec)
Deprecated.
|
void |
setAppInfo(String name,
String version)
Sets application's name/version to user agent.
|
void |
setBucketEncryption(SetBucketEncryptionArgs args)
Sets encryption configuration of a bucket.
|
void |
setBucketLifeCycle(SetBucketLifeCycleArgs args)
Sets life-cycle configuration to a bucket.
|
void |
setBucketLifeCycle(String bucketName,
String lifeCycle)
Deprecated.
|
void |
setBucketNotification(SetBucketNotificationArgs args)
Sets notification configuration to a bucket.
|
void |
setBucketNotification(String bucketName,
NotificationConfiguration notificationConfiguration)
Deprecated.
|
void |
setBucketPolicy(SetBucketPolicyArgs args)
Sets bucket policy configuration to a bucket.
|
void |
setBucketPolicy(String bucketName,
String policy)
Deprecated.
|
void |
setBucketTags(SetBucketTagsArgs args)
Sets tags to a bucket.
|
void |
setDefaultRetention(SetDefaultRetentionArgs args)
Sets default object retention in a bucket.
|
void |
setDefaultRetention(String bucketName,
ObjectLockConfiguration config)
Deprecated.
|
void |
setObjectRetention(SetObjectRetentionArgs args)
Sets retention configuration to an object.
|
void |
setObjectRetention(String bucketName,
String objectName,
String versionId,
Retention config,
boolean bypassGovernanceMode)
Deprecated.
|
void |
setObjectTags(SetObjectTagsArgs args)
Sets tags to an object.
|
void |
setTimeout(long connectTimeout,
long writeTimeout,
long readTimeout)
Sets HTTP connect, write and read timeouts.
|
ObjectStat |
statObject(StatObjectArgs args)
Gets information of an object.
|
ObjectStat |
statObject(String bucketName,
String objectName)
Deprecated.
|
ObjectStat |
statObject(String bucketName,
String objectName,
ServerSideEncryptionCustomerKey ssec)
Deprecated.
|
void |
traceOff()
Disables HTTP call tracing previously enabled.
|
void |
traceOn(OutputStream traceStream)
Enables HTTP call tracing and written to traceStream.
|
ObjectWriteResponse |
uploadObject(UploadObjectArgs args)
Uploads data from a file to an object.
|
protected String |
uploadPart(String bucketName,
String objectName,
Object data,
int length,
String uploadId,
int partNumber,
Map<String,String> headerMap)
|
protected String |
uploadPartCopy(String bucketName,
String objectName,
String uploadId,
int partNumber,
com.google.common.collect.Multimap<String,String> headers)
|
@Deprecated public MinioClient(String endpoint) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("https://play.min.io");
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(URL url) throws InvalidEndpointException, InvalidPortException
Example:
MinioClient minioClient = new MinioClient(new URL("https://play.min.io"));
url - Endpoint as URL object.IllegalArgumentException - Throws to indicate invalid argument passed.InvalidEndpointExceptionInvalidPortExceptionbuilder()@Deprecated public MinioClient(okhttp3.HttpUrl url) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient(new HttpUrl.parse("https://play.min.io"));
url - Endpoint as HttpUrl object.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, String accessKey, String secretKey) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("https://play.min.io",
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, String accessKey, String secretKey, String region) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("https://play.min.io",
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", "us-west-1");
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.region - Region name of buckets in S3 service.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(URL url, String accessKey, String secretKey) throws IllegalArgumentException
MinioClient minioClient = new MinioClient(new URL("https://play.min.io"),
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");url - Endpoint as URL object.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.IllegalArgumentException - Throws to indicate invalid argument passed.MinioClient(String endpoint),
MinioClient(URL url),
MinioClient(String endpoint, String accessKey, String secretKey),
MinioClient(String endpoint, String accessKey, String secretKey, String region),
MinioClient(String endpoint, int port, String accessKey, String secretKey),
MinioClient(String endpoint, String accessKey, String secretKey, boolean secure),
MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean
secure),
MinioClient(String endpoint, int port, String accessKey, String secretKey, String region,
boolean secure),
MinioClient(String endpoint, Integer port, String accessKey, String secretKey, String
region, Boolean secure, OkHttpClient httpClient)@Deprecated public MinioClient(okhttp3.HttpUrl url, String accessKey, String secretKey) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient(HttpUrl.parse("https://play.min.io"),
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
url - Endpoint as HttpUrl object.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, int port, String accessKey, String secretKey) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("play.min.io", 9000,
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1port - TCP/IP port number between 1 and 65535. Unused if endpoint is an URL.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, String accessKey, String secretKey, boolean secure) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("play.min.io",
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.secure - Flag to indicate to use secure (TLS) connection to S3 service or not.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean secure) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("play.min.io", 9000,
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1port - TCP/IP port number between 1 and 65535. Unused if endpoint is an URL.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.secure - Flag to indicate to use secure (TLS) connection to S3 service or not.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, int port, String accessKey, String secretKey, String region, boolean secure) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("play.min.io", 9000,
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1port - TCP/IP port number between 1 and 65535. Unused if endpoint is an URL.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.region - Region name of buckets in S3 service.secure - Flag to indicate to use secure (TLS) connection to S3 service or not.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public MinioClient(String endpoint, Integer port, String accessKey, String secretKey, String region, Boolean secure, okhttp3.OkHttpClient httpClient) throws IllegalArgumentException
Example:
MinioClient minioClient = new MinioClient("play.min.io", 9000,
"Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true,
customHttpClient);
endpoint - Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service.
Examples:
* https://s3.amazonaws.com
* https://s3.amazonaws.com/
* https://play.min.io
* http://play.min.io:9010/
* localhost
* localhost.localdomain
* play.min.io
* 127.0.0.1
* 192.168.1.60
* ::1port - TCP/IP port number between 1 and 65535. Overrides if it is non-null.accessKey - Access key (aka user ID) of your account in S3 service.secretKey - Secret Key (aka password) of your account in S3 service.region - Region name of buckets in S3 service.secure - Flag to indicate to use secure (TLS) connection to S3 service or not. Overrides
if it is non-null.httpClient - Customized HTTP client object.IllegalArgumentException - Throws to indicate invalid argument passed.builder()@Deprecated public ObjectStat statObject(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
statObject(StatObjectArgs)Example:
ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ObjectStat - Populated object information and metadata.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public ObjectStat statObject(String bucketName, String objectName, ServerSideEncryptionCustomerKey ssec) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
statObject(StatObjectArgs)Example:
ObjectStat objectStat =
minioClient.statObject("my-bucketname", "my-objectname", ssec);
bucketName - Name of the bucket.objectName - Object name in the bucket.ssec - SSE-C type server-side encryption.ObjectStat - Populated object information and metadata.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectStat statObject(StatObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Get information of an object.
ObjectStat objectStat =
minioClient.statObject(
StatObjectArgs.builder().bucket("my-bucketname").object("my-objectname").build());
// Get information of SSE-C encrypted object.
ObjectStat objectStat =
minioClient.statObject(
StatObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.ssec(ssec)
.build());
// Get information of a versioned object.
ObjectStat objectStat =
minioClient.statObject(
StatObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.versionId("version-id")
.build());
// Get information of a SSE-C encrypted versioned object.
ObjectStat objectStat =
minioClient.statObject(
StatObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.versionId("version-id")
.ssec(ssec)
.build());
args - StatObjectArgs object.ObjectStat - Populated object information and metadata.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionObjectStatpublic String getObjectUrl(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
String url = minioClient.getObjectUrl("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public InputStream getObject(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)InputStream must be closed after use to release
network resources.
Example:
try (InputStream stream =
minioClient.getObject("my-bucketname", "my-objectname")) {
// Read data from stream
}
bucketName - Name of the bucket.objectName - Object name in the bucket.InputStream - Contains object data.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public InputStream getObject(String bucketName, String objectName, ServerSideEncryptionCustomerKey ssec) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)InputStream must be closed after use to
release network resources.
Example:
try (InputStream stream =
minioClient.getObject("my-bucketname", "my-objectname", ssec)) {
// Read data from stream
}
bucketName - Name of the bucket.objectName - Object name in the bucket.ssec - SSE-C type server-side encryption.InputStream - Contains object data.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public InputStream getObject(String bucketName, String objectName, long offset) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)InputStream must be closed after use to
release network resources.
Example:
try (InputStream stream =
minioClient.getObject("my-bucketname", "my-objectname", 1024L)) {
// Read data from stream
}
bucketName - Name of the bucket.objectName - Object name in the bucket.offset - Start byte position of object data.InputStream - Contains object data.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public InputStream getObject(String bucketName, String objectName, long offset, Long length) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)InputStream must be closed after
use to release network resources.
Example:
try (InputStream stream =
minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L)) {
// Read data from stream
}
bucketName - Name of the bucket.objectName - Object name in the bucket.offset - Start byte position of object data.length - Number of bytes of object data from offset.InputStream - Contains object data.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public InputStream getObject(String bucketName, String objectName, Long offset, Long length, ServerSideEncryptionCustomerKey ssec) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)InputStream must
be closed after use to release network resources.
Example:
try (InputStream stream =
minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L, ssec)) {
// Read data from stream
}
bucketName - Name of the bucket.objectName - Object name in the bucket.offset - Start byte position of object data.length - Number of bytes of object data from offset.ssec - SSE-C type server-side encryption.InputStream - Contains object data.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic InputStream getObject(GetObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
InputStream must
be closed after use to release network resources.
Example:
try (InputStream stream =
minioClient.getObject(
GetObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.offset(offset)
.length(len)
.ssec(ssec)
.build()
) {
// Read data from stream
}
args - Object of GetObjectArgsErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void getObject(String bucketName, String objectName, String fileName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)Example:
minioClient.getObject("my-bucketname", "my-objectname", "my-object-file");
bucketName - Name of the bucket.objectName - Object name in the bucket.fileName - Name of the file.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void getObject(String bucketName, String objectName, ServerSideEncryptionCustomerKey ssec, String fileName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObject(GetObjectArgs)Example:
minioClient.getObject("my-bucketname", "my-objectname", ssec, "my-object-file");
bucketName - Name of the bucket.objectName - Object name in the bucket.ssec - SSE-C type server-side encryption.fileName - Name of the file.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void downloadObject(DownloadObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.downloadObject(
GetObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.ssec(ssec)
.fileName("my-filename")
.build());
args - Object of DownloadObjectArgsErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void copyObject(String bucketName, String objectName, Map<String,String> headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
copyObject(CopyObjectArgs)Example:
// Copy data from my-source-bucketname/my-objectname to my-bucketname/my-objectname.
minioClient.copyObject("my-bucketname", "my-objectname", null, null,
"my-source-bucketname", null, null, null);
// Copy data from my-source-bucketname/my-source-objectname to
// my-bucketname/my-objectname.
minioClient.copyObject("my-bucketname", "my-objectname", null, null,
"my-source-bucketname", "my-source-objectname", null, null);
// Copy data from my-source-bucketname/my-objectname to my-bucketname/my-objectname
// by server-side encryption.
minioClient.copyObject("my-bucketname", "my-objectname", null, sse,
"my-source-bucketname", null, null, null);
// Copy data from SSE-C encrypted my-source-bucketname/my-objectname to
// my-bucketname/my-objectname.
minioClient.copyObject("my-bucketname", "my-objectname", null, null,
"my-source-bucketname", null, srcSsec, null);
// Copy data from my-source-bucketname/my-objectname to my-bucketname/my-objectname
// with user metadata and copy conditions.
minioClient.copyObject("my-bucketname", "my-objectname", headers, null,
"my-source-bucketname", null, null, conditions);
bucketName - Name of the bucket.objectName - Object name to be created.headerMap - (Optional) User metadata.sse - (Optional) Server-side encryption.srcBucketName - Source bucket name.srcObjectName - (Optional) Source object name.srcSse - (Optional) SSE-C type server-side encryption of source object.copyConditions - (Optional) Conditiions to be used in copy operation.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectWriteResponse copyObject(CopyObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Create object "my-objectname" in bucket "my-bucketname" by copying from object
// "my-objectname" in bucket "my-source-bucketname".
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.srcBucket("my-source-bucketname")
.build());
// Create object "my-objectname" in bucket "my-bucketname" by copying from object
// "my-source-objectname" in bucket "my-source-bucketname".
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.srcBucket("my-source-bucketname")
.srcObject("my-source-objectname")
.build());
// Create object "my-objectname" in bucket "my-bucketname" with server-side encryption by
// copying from object "my-objectname" in bucket "my-source-bucketname".
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.srcBucket("my-source-bucketname")
.sse(sse)
.build());
// Create object "my-objectname" in bucket "my-bucketname" by copying from SSE-C encrypted
// object "my-source-objectname" in bucket "my-source-bucketname".
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.srcBucket("my-source-bucketname")
.srcObject("my-source-objectname")
.srcSsec(ssec)
.build());
// Create object "my-objectname" in bucket "my-bucketname" with custom headers by copying from
// object "my-objectname" in bucket "my-source-bucketname" using conditions.
minioClient.copyObject(
CopyObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.srcBucket("my-source-bucketname")
.headers(headers)
.srcMatchETag(etag)
.build());
args - CopyObjectArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void composeObject(String bucketName, String objectName, List<ComposeSource> sources, Map<String,String> headerMap, ServerSideEncryption sse) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
composeObject(ComposeObjectArgs)Example:
List<ComposeSource> sourceObjectList = new ArrayList<ComposeSource>();
sourceObjectList.add(new ComposeSource("my-job-bucket", "my-objectname-part-one"));
sourceObjectList.add(new ComposeSource("my-job-bucket", "my-objectname-part-two"));
sourceObjectList.add(new ComposeSource("my-job-bucket", "my-objectname-part-three"));
// Create my-bucketname/my-objectname by combining source object list.
minioClient.composeObject("my-bucketname", "my-objectname", sourceObjectList,
null, null);
// Create my-bucketname/my-objectname with user metadata by combining source object
// list.
minioClient.composeObject("my-bucketname", "my-objectname", sourceObjectList,
userMetadata, null);
// Create my-bucketname/my-objectname with user metadata and server-side encryption
// by combining source object list.
minioClient.composeObject("my-bucketname", "my-objectname", sourceObjectList,
userMetadata, sse);
bucketName - Destination Bucket to be created upon compose.objectName - Destination Object to be created upon compose.sources - List of Source Objects used to compose Object.headerMap - User Meta data.sse - Server Side Encryption.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectWriteResponse composeObject(ComposeObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
List<ComposeSource> sourceObjectList = new ArrayList<ComposeSource>();
sourceObjectList.add(
ComposeSource.builder().bucket("my-job-bucket").object("my-objectname-part-one").build());
sourceObjectList.add(
ComposeSource.builder().bucket("my-job-bucket").object("my-objectname-part-two").build());
sourceObjectList.add(
ComposeSource.builder().bucket("my-job-bucket").object("my-objectname-part-three").build());
// Create my-bucketname/my-objectname by combining source object list.
minioClient.composeObject(
ComposeObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.sources(sourceObjectList)
.build());
// Create my-bucketname/my-objectname with user metadata by combining source object
// list.
minioClient.composeObject(
ComposeObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.sources(sourceObjectList)
.build());
// Create my-bucketname/my-objectname with user metadata and server-side encryption
// by combining source object list.
minioClient.composeObject(
ComposeObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.sources(sourceObjectList)
.ssec(sse)
.build());
args - ComposeObjectArgs object.ObjectWriteResponse object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String getPresignedObjectUrl(Method method, String bucketName, String objectName, Integer expires, Map<String,String> reqParams) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
String url = minioClient.getPresignedObjectUrl(Method.DELETE, "my-bucketname",
"my-objectname", 24 * 60 * 60, reqParams);
method - HTTP Method to generate presigned URL.bucketName - Name of the bucket.objectName - Object name in the bucket.expires - Expiry in seconds; defaults to 7 days.reqParams - Request parameters to override. Supported headers are response-expires,
response-content-type, response-cache-control and response-content-disposition.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic String getPresignedObjectUrl(GetPresignedObjectUrlArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException, ServerException
Example:
// Get presigned URL string to delete 'my-objectname' in 'my-bucketname' and its life time
// is one day.
String url =
minioClient.getPresignedObjectUrl(
GetPresignedObjectUrlArgs.builder()
.method(Method.DELETE)
.bucket("my-bucketname")
.object("my-objectname")
.expiry(24 * 60 * 60)
.build());
System.out.println(url);
// Get presigned URL string to upload 'my-objectname' in 'my-bucketname'
// with response-content-type as application/json and life time as one day.
Map<String, String> reqParams = new HashMap<String, String>();
reqParams.put("response-content-type", "application/json");
String url =
minioClient.getPresignedObjectUrl(
GetPresignedObjectUrlArgs.builder()
.method(Method.PUT)
.bucket("my-bucketname")
.object("my-objectname")
.expiry(1, TimeUnit.DAYS)
.extraQueryParams(reqParams)
.build());
System.out.println(url);
// Get presigned URL string to download 'my-objectname' in 'my-bucketname' and its life time
// is 2 hours.
String url =
minioClient.getPresignedObjectUrl(
GetPresignedObjectUrlArgs.builder()
.method(Method.GET)
.bucket("my-bucketname")
.object("my-objectname")
.expiry(2, TimeUnit.HOURS)
.build());
System.out.println(url);
args - GetPresignedObjectUrlArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String presignedGetObject(String bucketName, String objectName, Integer expires, Map<String,String> reqParams) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
// Get presigned URL to download my-objectname data with one day expiry and request
// parameters.
String url = minioClient.presignedGetObject("my-bucketname", "my-objectname",
24 * 60 * 60, reqParams);
bucketName - Name of the bucket.objectName - Object name in the bucket.expires - Expiry in seconds; defaults to 7 days.reqParams - Request parameters to override. Supported headers are response-expires,
response-content-type, response-cache-control and response-content-disposition.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String presignedGetObject(String bucketName, String objectName, Integer expires) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
// Get presigned URL to download my-objectname data with one day expiry.
String url = minioClient.presignedGetObject("my-bucketname", "my-objectname",
24 * 60 * 60);
bucketName - Name of the bucket.objectName - Object name in the bucket.expires - Expiry in seconds; defaults to 7 days.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String presignedGetObject(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
String url = minioClient.presignedGetObject("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String presignedPutObject(String bucketName, String objectName, Integer expires) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
// Get presigned URL to upload data to my-objectname with one day expiry.
String url =
minioClient.presignedPutObject("my-bucketname", "my-objectname", 24 * 60 * 60);
bucketName - Name of the bucket.objectName - Object name in the bucket.expires - Expiry in seconds; defaults to 7 days.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String presignedPutObject(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getPresignedObjectUrl(GetPresignedObjectUrlArgs)Example:
String url = minioClient.presignedPutObject("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic Map<String,String> presignedPostPolicy(PostPolicy policy) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidExpiresRangeException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
PostPolicy of an object to upload its data using POST method.
Example:
PostPolicy policy = new PostPolicy("my-bucketname", "my-objectname",
ZonedDateTime.now().plusDays(7));
// 'my-objectname' should be 'image/png' content type
policy.setContentType("image/png");
// set success action status to 201 to receive XML document
policy.setSuccessActionStatus(201);
Map<String,String> formData = minioClient.presignedPostPolicy(policy);
// Print curl command to be executed by anonymous user to upload /tmp/userpic.png.
System.out.print("curl -X POST ");
for (Map.Entry<String,String> entry : formData.entrySet()) {
System.out.print(" -F " + entry.getKey() + "=" + entry.getValue());
}
System.out.println(" -F file=@/tmp/userpic.png https://play.min.io/my-bucketname");
policy - Post policy of an object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidExpiresRangeException - thrown to indicate invalid expiry duration passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionPostPolicy@Deprecated public void removeObject(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
removeObject(RemoveObjectArgs)Example:
minioClient.removeObject("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void removeObject(RemoveObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Remove object.
minioClient.removeObject(
RemoveObjectArgs.builder().bucket("my-bucketname").object("my-objectname").build());
// Remove versioned object.
minioClient.removeObject(
RemoveObjectArgs.builder()
.bucket("my-bucketname")
.object("my-versioned-objectname")
.versionId("my-versionid")
.build());
// Remove versioned object bypassing Governance mode.
minioClient.removeObject(
RemoveObjectArgs.builder()
.bucket("my-bucketname")
.object("my-versioned-objectname")
.versionId("my-versionid")
.bypassRetentionMode(true)
.build());
args - RemoveObjectArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public Iterable<Result<DeleteError>> removeObjects(String bucketName, Iterable<String> objectNames)
removeObjects(RemoveObjectsArgs)Example:
List<String> myObjectNames = new LinkedList<String>();
objectNames.add("my-objectname1");
objectNames.add("my-objectname2");
objectNames.add("my-objectname3");
Iterable<Result<DeleteError>> results =
minioClient.removeObjects("my-bucketname", myObjectNames);
for (Result<DeleteError> result : results) {
DeleteError error = errorResult.get();
System.out.println(
"Error in deleting object " + error.objectName() + "; " + error.message());
}
bucketName - Name of the bucket.objectNames - List of Object names in the bucket.public Iterable<Result<DeleteError>> removeObjects(RemoveObjectsArgs args)
Example:
List<DeleteObject> objects = new LinkedList<>();
objects.add(new DeleteObject("my-objectname1"));
objects.add(new DeleteObject("my-objectname2"));
objects.add(new DeleteObject("my-objectname3"));
Iterable<Result<DeleteError>> results =
minioClient.removeObjects(
RemoveObjectsArgs.builder().bucket("my-bucketname").objects(objects).build());
for (Result<DeleteError> result : results) {
DeleteError error = errorResult.get();
System.out.println(
"Error in deleting object " + error.objectName() + "; " + error.message());
}
args - RemoveObjectsArgs object.@Deprecated public Iterable<Result<Item>> listObjects(String bucketName) throws XmlParserException
listObjects(ListObjectsArgs)Example:
Iterable<Result<Item>> results = minioClient.listObjects("my-bucketname");
for (Result<Item> result : results) {
Item item = result.get();
System.out.println(
item.lastModified() + ", " + item.size() + ", " + item.objectName());
}
bucketName - Name of the bucket.XmlParserException - upon parsing response xml@Deprecated public Iterable<Result<Item>> listObjects(String bucketName, String prefix) throws XmlParserException
listObjects(ListObjectsArgs)Example:
Iterable<Result<Item>> results = minioClient.listObjects("my-bucketname", "my-obj");
for (Result<Item> result : results) {
Item item = result.get();
System.out.println(
item.lastModified() + ", " + item.size() + ", " + item.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.XmlParserException - upon parsing response xml@Deprecated public Iterable<Result<Item>> listObjects(String bucketName, String prefix, boolean recursive)
listObjects(ListObjectsArgs)Example:
Iterable<Result<Item>> results =
minioClient.listObjects("my-bucketname", "my-obj", true);
for (Result<Item> result : results) {
Item item = result.get();
System.out.println(
item.lastModified() + ", " + item.size() + ", " + item.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.recursive - List recursively than directory structure emulation.listObjects(String bucketName),
listObjects(String bucketName, String prefix),
listObjects(String bucketName, String prefix, boolean recursive, boolean useVersion1)@Deprecated public Iterable<Result<Item>> listObjects(String bucketName, String prefix, boolean recursive, boolean useVersion1)
listObjects(ListObjectsArgs)Example:
Iterable<Result<Item>> results =
minioClient.listObjects("my-bucketname", "my-obj", true, true);
for (Result<Item> result : results) {
Item item = result.get();
System.out.println(
item.lastModified() + ", " + item.size() + ", " + item.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.recursive - List recursively than directory structure emulation.useVersion1 - when true, version 1 of REST API is used.listObjects(String bucketName),
listObjects(String bucketName, String prefix),
listObjects(String bucketName, String prefix, boolean recursive)@Deprecated public Iterable<Result<Item>> listObjects(String bucketName, String prefix, boolean recursive, boolean includeUserMetadata, boolean useVersion1)
listObjects(ListObjectsArgs)Example:
Iterable<Result<Item>> results =
minioClient.listObjects("my-bucketname", "my-obj", true, true, false);
for (Result<Item> result : results) {
Item item = result.get();
System.out.println(
item.lastModified() + ", " + item.size() + ", " + item.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.recursive - List recursively than directory structure emulation.includeUserMetadata - include user metadata of each object. This is MinIO specific
extension to ListObjectsV2.useVersion1 - when true, version 1 of REST API is used.listObjects(String bucketName),
listObjects(String bucketName, String prefix),
listObjects(String bucketName, String prefix, boolean recursive)public Iterable<Result<Item>> listObjects(ListObjectsArgs args)
useVersion1 as true.
Example:
// Lists objects information.
Iterable<Result<Item>> results = minioClient.listObjects(
ListObjectsArgs.builder().bucket("my-bucketname").build());
// Lists objects information recursively.
Iterable<Result<Item>> results = minioClient.listObjects(
ListObjectsArgs.builder().bucket("my-bucketname").recursive(true).build());
// Lists maximum 100 objects information those names starts with 'E' and after
// 'ExampleGuide.pdf'.
Iterable<Result<Item>> results = minioClient.listObjects(
ListObjectsArgs.builder()
.bucket("my-bucketname")
.startAfter("ExampleGuide.pdf")
.prefix("E")
.maxKeys(100)
.build());
// Lists maximum 100 objects information with version those names starts with 'E' and after
// 'ExampleGuide.pdf'.
Iterable<Result<Item>> results = minioClient.listObjects(
ListObjectsArgs.builder()
.bucket("my-bucketname")
.startAfter("ExampleGuide.pdf")
.prefix("E")
.maxKeys(100)
.includeVersions(true)
.build());
args - Instance of ListObjectsArgs built using the builderXmlParserException - upon parsing response xmlpublic List<Bucket> listBuckets() throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
List<Bucket> bucketList = minioClient.listBuckets();
for (Bucket bucket : bucketList) {
System.out.println(bucket.creationDate() + ", " + bucket.name());
}
ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public boolean bucketExists(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
bucketExists(BucketExistsArgs)Example:
boolean found = minioClient.bucketExists("my-bucketname");
if (found) {
System.out.println("my-bucketname exists");
} else {
System.out.println("my-bucketname does not exist");
}
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic boolean bucketExists(BucketExistsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
boolean found =
minioClient.bucketExists(BucketExistsArgs.builder().bucket("my-bucketname").build());
if (found) {
System.out.println("my-bucketname exists");
} else {
System.out.println("my-bucketname does not exist");
}
args - BucketExistsArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void makeBucket(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, ServerException, XmlParserException
makeBucket(MakeBucketArgs)Example:
minioClient.makeBucket("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.RegionConflictException - thrown to indicate passed region conflict with default region.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void makeBucket(String bucketName, String region) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, ServerException, XmlParserException
makeBucket(MakeBucketArgs)Example:
minioClient.makeBucket("my-bucketname", "eu-west-1");
bucketName - Name of the bucket.region - Region in which the bucket will be created.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.RegionConflictException - thrown to indicate passed region conflict with default region.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void makeBucket(String bucketName, String region, boolean objectLock) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, ServerException, XmlParserException
makeBucket(MakeBucketArgs)Example:
minioClient.makeBucket("my-bucketname", "eu-west-2", true);
bucketName - Name of the bucket.region - Region in which the bucket will be created.objectLock - Flag to enable object lock feature.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.RegionConflictException - thrown to indicate passed region conflict with default region.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void makeBucket(MakeBucketArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, ServerException, XmlParserException
Example:
// Create bucket with default region.
minioClient.makeBucket(
MakeBucketArgs.builder()
.bucket("my-bucketname")
.build());
// Create bucket with specific region.
minioClient.makeBucket(
MakeBucketArgs.builder()
.bucket("my-bucketname")
.region("us-west-1")
.build());
// Create object-lock enabled bucket with specific region.
minioClient.makeBucket(
MakeBucketArgs.builder()
.bucket("my-bucketname")
.region("us-west-1")
.objectLock(true)
.build());
args - Object with bucket name, region and lock functionalityErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.RegionConflictException - thrown to indicate passed region conflict with default region.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void enableVersioning(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
enableVersioning(EnableVersioningArgs)Example:
minioClient.enableVersioning("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void enableVersioning(EnableVersioningArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.enableVersioning(EnableVersioningArgs.builder().bucket("my-bucketname").build());
args - EnableVersioningArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void disableVersioning(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
disableVersioning(DisableVersioningArgs)Example:
minioClient.disableVersioning("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void disableVersioning(DisableVersioningArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.disableVersioning(
DisableVersioningArgs.builder().bucket("my-bucketname").build());
args - DisableVersioningArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic boolean isVersioningEnabled(IsVersioningEnabledArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
boolean isVersioningEnabled =
minioClient.isVersioningEnabled(
IsVersioningEnabledArgs.builder().bucket("my-bucketname").build());
if (isVersioningEnabled) {
System.out.println("Bucket versioning is enabled");
} else {
System.out.println("Bucket versioning is disabled");
}
args - IsVersioningEnabledArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void setDefaultRetention(String bucketName, ObjectLockConfiguration config) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
setDefaultRetention(SetDefaultRetentionArgs)Example:
ObjectLockConfiguration config = new ObjectLockConfiguration(
RetentionMode.COMPLIANCE, new RetentionDurationDays(100));
minioClient.setDefaultRetention("my-bucketname", config);
bucketName - Name of the bucket.config - Object lock configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setDefaultRetention(SetDefaultRetentionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
ObjectLockConfiguration config = new ObjectLockConfiguration(
RetentionMode.COMPLIANCE, new RetentionDurationDays(100));
minioClient.setDefaultRetention(
SetDefaultRetentionArgs.builder().bucket("my-bucketname").config(config).build());
args - SetDefaultRetentionArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteDefaultRetention(DeleteDefaultRetentionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteDefaultRetention(
DeleteDefaultRetentionArgs.builder().bucket("my-bucketname").build());
args - DeleteDefaultRetentionArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public ObjectLockConfiguration getDefaultRetention(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getDefaultRetention(GetDefaultRetentionArgs)Example:
ObjectLockConfiguration config = minioClient.getDefaultRetention("my-bucketname");
System.out.println("Mode: " + config.mode());
System.out.println(
"Duration: " + config.duration().duration() + " " + config.duration().unit());
bucketName - Name of the bucket.ObjectLockConfiguration - Default retention configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectLockConfiguration getDefaultRetention(GetDefaultRetentionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
ObjectLockConfiguration config =
minioClient.getDefaultRetention(
GetDefaultRetentionArgs.builder().bucket("my-bucketname").build());
System.out.println("Mode: " + config.mode());
System.out.println(
"Duration: " + config.duration().duration() + " " + config.duration().unit());
args - GetDefaultRetentionArgs object.ObjectLockConfiguration - Default retention configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void setObjectRetention(String bucketName, String objectName, String versionId, Retention config, boolean bypassGovernanceMode) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
setObjectRetention(SetObjectRetentionArgs)Example:
Retention retention =
new Retention(RetentionMode.COMPLIANCE, ZonedDateTime.now().plusYears(1));
minioClient.setObjectRetention(
"my-bucketname", "my-objectname", null, retention, true);
bucketName - Name of the bucket.objectName - Object name in the bucket.versionId - Version ID of the object.config - Object retention configuration.bypassGovernanceMode - Bypass Governance retention.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setObjectRetention(SetObjectRetentionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Retention retention = new Retention(
RetentionMode.COMPLIANCE, ZonedDateTime.now().plusYears(1));
minioClient.setObjectRetention(
SetObjectRetentionArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.config(config)
.bypassGovernanceMode(true)
.build());
args - SetObjectRetentionArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public Retention getObjectRetention(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getObjectRetention(GetObjectRetentionArgs)Example:
Retention retention =
minioClient.getObjectRetention("my-bucketname", "my-objectname", null);
System.out.println(
"mode: " + retention.mode() + "until: " + retention.retainUntilDate());
bucketName - Name of the bucket.objectName - Object name in the bucket.versionId - Version ID of the object.Retention - Object retention configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic Retention getObjectRetention(GetObjectRetentionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Retention retention =
minioClient.getObjectRetention(GetObjectRetentionArgs.builder()
.bucket(bucketName)
.object(objectName)
.versionId(versionId)
.build()););
System.out.println(
"mode: " + retention.mode() + "until: " + retention.retainUntilDate());
args - GetObjectRetentionArgs object.Retention - Object retention configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void enableObjectLegalHold(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
enableObjectLegalHold(EnableObjectLegalHoldArgs)Example:
minioClient.enableObjectLegalHold("my-bucketname", "my-object", null);
bucketName - Name of the bucket.objectName - Object name in the bucket.versionId - Version ID of the object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void enableObjectLegalHold(EnableObjectLegalHoldArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.enableObjectLegalHold(
EnableObjectLegalHoldArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.versionId("object-versionId")
.build());
args - EnableObjectLegalHoldArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void disableObjectLegalHold(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
disableObjectLegalHold(DisableObjectLegalHoldArgs)Example:
minioClient.disableObjectLegalHold("my-bucketname", "my-object", null);
bucketName - Name of the bucket.objectName - Object name in the bucket.versionId - Version ID of the object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void disableObjectLegalHold(DisableObjectLegalHoldArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.disableObjectLegalHold(
DisableObjectLegalHoldArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.versionId("object-versionId")
.build());
args - DisableObjectLegalHoldArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public boolean isObjectLegalHoldEnabled(String bucketName, String objectName, String versionId) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
isObjectLegalHoldEnabled(IsObjectLegalHoldEnabledArgs)Example:
boolean status =
s3Client.isObjectLegalHoldEnabled("my-bucketname", "my-objectname", null);
if (status) {
System.out.println("Legal hold is on");
} else {
System.out.println("Legal hold is off");
}
bucketName - Name of the bucket.objectName - Object name in the bucket.versionId - Version ID of the object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic boolean isObjectLegalHoldEnabled(IsObjectLegalHoldEnabledArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
boolean status =
s3Client.isObjectLegalHoldEnabled(
IsObjectLegalHoldEnabledArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.versionId("object-versionId")
.build());
if (status) {
System.out.println("Legal hold is on");
} else {
System.out.println("Legal hold is off");
}
args IsObjectLegalHoldEnabledArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void removeBucket(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
removeBucket(RemoveBucketArgs)Example:
minioClient.removeBucket("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void removeBucket(RemoveBucketArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.removeBucket(RemoveBucketArgs.builder().bucket("my-bucketname").build());
args - RemoveBucketArgs bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void putObject(String bucketName, String objectName, String filename, PutObjectOptions options) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
uploadObject(UploadObjectArgs)PutObjectOptions.
Example:
minioClient.putObject("my-bucketname", "my-objectname", "my-filename", null);
bucketName - Name of the bucket.objectName - Object name in the bucket.filename - Name of file to upload.options - PutObjectOptions to be used during upload.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void putObject(String bucketName, String objectName, InputStream stream, PutObjectOptions options) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
putObject(PutObjectArgs)PutObjectOptions.
Example:
PutObjectOptions options = new PutObjectOptions(7003256, -1);
minioClient.putObject("my-bucketname", "my-objectname", stream, options);
bucketName - Name of the bucket.objectName - Object name in the bucket.stream - Stream contains object data.options - PutObjectOptions to be used during upload.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectWriteResponse putObject(PutObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Upload known sized input stream.
minioClient.putObject(
PutObjectArgs.builder().bucket("my-bucketname").object("my-objectname").stream(
inputStream, size, -1)
.contentType("video/mp4")
.build());
// Upload unknown sized input stream.
minioClient.putObject(
PutObjectArgs.builder().bucket("my-bucketname").object("my-objectname").stream(
inputStream, -1, 10485760)
.contentType("video/mp4")
.build());
// Create object ends with '/' (also called as folder or directory).
minioClient.putObject(
PutObjectArgs.builder().bucket("my-bucketname").object("path/to/").stream(
new ByteArrayInputStream(new byte[] {}), 0, -1)
.build());
// Upload input stream with headers and user metadata.
Map<String, String> headers = new HashMap<>();
headers.put("X-Amz-Storage-Class", "REDUCED_REDUNDANCY");
Map<String, String> userMetadata = new HashMap<>();
userMetadata.put("My-Project", "Project One");
minioClient.putObject(
PutObjectArgs.builder().bucket("my-bucketname").object("my-objectname").stream(
inputStream, size, -1)
.headers(headers)
.userMetadata(userMetadata)
.build());
// Upload input stream with server-side encryption.
minioClient.putObject(
PutObjectArgs.builder().bucket("my-bucketname").object("my-objectname").stream(
inputStream, size, -1)
.sse(sse)
.build());
args - PutObjectArgs object.ObjectWriteResponse object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic ObjectWriteResponse uploadObject(UploadObjectArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Upload an JSON file.
minioClient.uploadObject(
UploadObjectArgs.builder()
.bucket("my-bucketname").object("my-objectname").filename("person.json").build());
// Upload a video file.
minioClient.uploadObject(
UploadObjectArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.filename("my-video.avi")
.contentType("video/mp4")
.build());
args - UploadObjectArgs object.ObjectWriteResponse object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String getBucketPolicy(String bucketName) throws BucketPolicyTooLargeException, ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getBucketPolicy(GetBucketPolicyArgs)Example:
String config = minioClient.getBucketPolicy("my-bucketname");
bucketName - Name of the bucket.BucketPolicyTooLargeException - thrown to indicate returned bucket policy is too large.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic String getBucketPolicy(GetBucketPolicyArgs args) throws BucketPolicyTooLargeException, ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
String config =
minioClient.getBucketPolicy(GetBucketPolicyArgs.builder().bucket("my-bucketname").build());
args - GetBucketPolicyArgs object.BucketPolicyTooLargeException - thrown to indicate returned bucket policy is too large.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void setBucketPolicy(String bucketName, String policy) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
setBucketPolicy(SetBucketPolicyArgs)Example:
// Assume policyJson contains below JSON string;
// {
// "Statement": [
// {
// "Action": [
// "s3:GetBucketLocation",
// "s3:ListBucket"
// ],
// "Effect": "Allow",
// "Principal": "*",
// "Resource": "arn:aws:s3:::my-bucketname"
// },
// {
// "Action": "s3:GetObject",
// "Effect": "Allow",
// "Principal": "*",
// "Resource": "arn:aws:s3:::my-bucketname/myobject*"
// }
// ],
// "Version": "2012-10-17"
// }
//
minioClient.setBucketPolicy("my-bucketname", policyJson);
bucketName - Name of the bucket.policy - Bucket policy configuration as JSON string.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setBucketPolicy(SetBucketPolicyArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Assume policyJson contains below JSON string;
// {
// "Statement": [
// {
// "Action": [
// "s3:GetBucketLocation",
// "s3:ListBucket"
// ],
// "Effect": "Allow",
// "Principal": "*",
// "Resource": "arn:aws:s3:::my-bucketname"
// },
// {
// "Action": "s3:GetObject",
// "Effect": "Allow",
// "Principal": "*",
// "Resource": "arn:aws:s3:::my-bucketname/myobject*"
// }
// ],
// "Version": "2012-10-17"
// }
//
minioClient.setBucketPolicy(
SetBucketPolicyArgs.builder().bucket("my-bucketname").config(policyJson).build());
args - SetBucketPolicyArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteBucketPolicy(DeleteBucketPolicyArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteBucketPolicy(DeleteBucketPolicyArgs.builder().bucket("my-bucketname"));
args - DeleteBucketPolicyArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void setBucketLifeCycle(String bucketName, String lifeCycle) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
setBucketLifeCycle(SetBucketLifeCycleArgs)Example:
// Lets consider variable 'lifeCycleXml' contains below XML String;
// <LifecycleConfiguration>
// <Rule>
// <ID>expire-bucket</ID>
// <Prefix></Prefix>
// <Status>Enabled</Status>
// <Expiration>
// <Days>365</Days>
// </Expiration>
// </Rule>
// </LifecycleConfiguration>
//
minioClient.setBucketLifeCycle("my-bucketname", lifeCycleXml);
bucketName - Name of the bucket.lifeCycle - Life cycle configuraion as XML string.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setBucketLifeCycle(SetBucketLifeCycleArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
// Lets consider variable 'lifeCycleXml' contains below XML String;
// <LifecycleConfiguration>
// <Rule>
// <ID>expire-bucket</ID>
// <Prefix></Prefix>
// <Status>Enabled</Status>
// <Expiration>
// <Days>365</Days>
// </Expiration>
// </Rule>
// </LifecycleConfiguration>
//
minioClient.setBucketLifeCycle(
SetBucketLifeCycleArgs.builder().bucket("my-bucketname").config(lifeCycleXml).build());
args - SetBucketLifeCycleArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void deleteBucketLifeCycle(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
deleteBucketLifeCycle(DeleteBucketLifeCycleArgs)Example:
deleteBucketLifeCycle("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteBucketLifeCycle(DeleteBucketLifeCycleArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
deleteBucketLifeCycle(DeleteBucketLifeCycleArgs.builder().bucket("my-bucketname").build());
args - DeleteBucketLifeCycleArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public String getBucketLifeCycle(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getBucketLifeCycle(GetBucketLifeCycleArgs)Example:
String lifecycle = minioClient.getBucketLifeCycle("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic String getBucketLifeCycle(GetBucketLifeCycleArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
String lifecycle =
minioClient.getBucketLifeCycle(
GetBucketLifeCycleArgs.builder().bucket("my-bucketname").build());
args - GetBucketLifeCycleArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public NotificationConfiguration getBucketNotification(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
getBucketNotification(GetBucketNotificationArgs)Example:
NotificationConfiguration config =
minioClient.getBucketNotification("my-bucketname");
bucketName - Name of the bucket.NotificationConfiguration - Notification configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic NotificationConfiguration getBucketNotification(GetBucketNotificationArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
NotificationConfiguration config =
minioClient.getBucketNotification(
GetBucketNotificationArgs.builder().bucket("my-bucketname").build());
args - GetBucketNotificationArgs object.NotificationConfiguration - Notification configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void setBucketNotification(String bucketName, NotificationConfiguration notificationConfiguration) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
setBucketNotification(SetBucketNotificationArgs)Example:
List<EventType> eventList = new LinkedList<>();
eventList.add(EventType.OBJECT_CREATED_PUT);
eventList.add(EventType.OBJECT_CREATED_COPY);
QueueConfiguration queueConfiguration = new QueueConfiguration();
queueConfiguration.setQueue("arn:minio:sqs::1:webhook");
queueConfiguration.setEvents(eventList);
queueConfiguration.setPrefixRule("images");
queueConfiguration.setSuffixRule("pg");
List<QueueConfiguration> queueConfigurationList = new LinkedList<>();
queueConfigurationList.add(queueConfiguration);
NotificationConfiguration config = new NotificationConfiguration();
config.setQueueConfigurationList(queueConfigurationList);
minioClient.setBucketNotification("my-bucketname", config);
bucketName - Name of the bucket.notificationConfiguration - NotificationConfiguration to be set.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setBucketNotification(SetBucketNotificationArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
List<EventType> eventList = new LinkedList<>();
eventList.add(EventType.OBJECT_CREATED_PUT);
eventList.add(EventType.OBJECT_CREATED_COPY);
QueueConfiguration queueConfiguration = new QueueConfiguration();
queueConfiguration.setQueue("arn:minio:sqs::1:webhook");
queueConfiguration.setEvents(eventList);
queueConfiguration.setPrefixRule("images");
queueConfiguration.setSuffixRule("pg");
List<QueueConfiguration> queueConfigurationList = new LinkedList<>();
queueConfigurationList.add(queueConfiguration);
NotificationConfiguration config = new NotificationConfiguration();
config.setQueueConfigurationList(queueConfigurationList);
minioClient.setBucketNotification(
SetBucketNotificationArgs.builder().bucket("my-bucketname").config(config).build());
args - SetBucketNotificationArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public void removeAllBucketNotification(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
deleteBucketNotification(DeleteBucketNotificationArgs)Example:
minioClient.removeAllBucketNotification("my-bucketname");
bucketName - Name of the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteBucketNotification(DeleteBucketNotificationArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteBucketNotification(
DeleteBucketNotificationArgs.builder().bucket("my-bucketname").build());
args - DeleteBucketNotificationArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public Iterable<Result<Upload>> listIncompleteUploads(String bucketName) throws XmlParserException
listIncompleteUploads(ListIncompleteUploadsArgs)Example:
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads("my-bucketname");
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
bucketName - Name of the bucket.XmlParserException@Deprecated public Iterable<Result<Upload>> listIncompleteUploads(String bucketName, String prefix) throws XmlParserException
listIncompleteUploads(ListIncompleteUploadsArgs)Example:
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads("my-bucketname", "my-obj");
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.XmlParserException - upon parsing response xml@Deprecated public Iterable<Result<Upload>> listIncompleteUploads(String bucketName, String prefix, boolean recursive)
listIncompleteUploads(ListIncompleteUploadsArgs)Example:
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads("my-bucketname", "my-obj", true);
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
bucketName - Name of the bucket.prefix - Object name starts with prefix.recursive - List recursively than directory structure emulation.public Iterable<Result<Upload>> listIncompleteUploads(ListIncompleteUploadsArgs args)
Example:
// Lists incomplete object upload information of a bucket.
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads(
ListIncompleteUploadsArgs.builder().bucket("my-bucketname").build());
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
// Lists incomplete object upload information of a bucket for prefix.
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads(
ListIncompleteUploadsArgs.builder()
.bucket("my-bucketname")
.prefix("my-obj")
.build());
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
// Lists incomplete object upload information of a bucket for prefix recursively.
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads(
ListIncompleteUploadsArgs.builder()
.bucket("my-bucketname")
.prefix("my-obj")
.recursive(true)
.build());
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
// Lists incomplete object upload information of a bucket for prefix, delimiter.
// keyMarker, uploadIdMarker and maxUpload to 500
Iterable<Result<Upload>> results =
minioClient.listIncompleteUploads(
ListIncompleteUploadsArgs.builder()
.bucket("my-bucketname")
.prefix("my-obj")
.delimiter("-")
.keyMarker("b")
.maxUploads(500)
.uploadIdMarker("k")
.build());
for (Result<Upload> result : results) {
Upload upload = result.get();
System.out.println(upload.uploadId() + ", " + upload.objectName());
}
args - ListIncompleteUploadsArgs objects.@Deprecated public void removeIncompleteUpload(String bucketName, String objectName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
removeIncompleteUpload(RemoveIncompleteUploadArgs)Example:
minioClient.removeIncompleteUpload("my-bucketname", "my-objectname");
bucketName - Name of the bucket.objectName - Object name in the bucket.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void removeIncompleteUpload(RemoveIncompleteUploadArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.removeIncompleteUpload(
RemoveIncompleteUploadArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.build());
args - instance of RemoveIncompleteUploadArgsErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public CloseableIterator<Result<NotificationRecords>> listenBucketNotification(String bucketName, String prefix, String suffix, String[] events) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
listenBucketNotification(ListenBucketNotificationArgs)Example:
String[] events = {"s3:ObjectCreated:*", "s3:ObjectAccessed:*"};
try (CloseableIterator<Result<NotificationInfo>> ci =
minioClient.listenBucketNotification("bucketName", "", "", events)) {
while (ci.hasNext()) {
NotificationRecords records = ci.next().get();
for (Event event : records.events()) {
System.out.println("Event " + event.eventType() + " occurred at "
+ event.eventTime() + " for " + event.bucketName() + "/"
+ event.objectName());
}
}
}
bucketName - Name of the bucket.prefix - Listen events of object starts with prefix.suffix - Listen events of object ends with suffix.events - Events to listen.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic CloseableIterator<Result<NotificationRecords>> listenBucketNotification(ListenBucketNotificationArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
String[] events = {"s3:ObjectCreated:*", "s3:ObjectAccessed:*"};
try (CloseableIterator<Result<NotificationRecords>> ci =
minioClient.listenBucketNotification(
ListenBucketNotificationArgs.builder()
.bucket("bucketName")
.prefix("")
.suffix("")
.events(events)
.build())) {
while (ci.hasNext()) {
NotificationRecords records = ci.next().get();
for (Event event : records.events()) {
System.out.println("Event " + event.eventType() + " occurred at "
+ event.eventTime() + " for " + event.bucketName() + "/"
+ event.objectName());
}
}
}
args - ListenBucketNotificationArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated public SelectResponseStream selectObjectContent(String bucketName, String objectName, String sqlExpression, InputSerialization is, OutputSerialization os, boolean requestProgress, Long scanStartRange, Long scanEndRange, ServerSideEncryptionCustomerKey ssec) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
selectObjectContent(SelectObjectContentArgs)Example:
String sqlExpression = "select * from S3Object";
InputSerialization is =
new InputSerialization(null, false, null, null, FileHeaderInfo.USE, null, null,
null);
OutputSerialization os =
new OutputSerialization(null, null, null, QuoteFields.ASNEEDED, null);
SelectResponseStream stream =
minioClient.selectObjectContent("my-bucketname", "my-objectName", sqlExpression,
is, os, true, null, null, null);
byte[] buf = new byte[512];
int bytesRead = stream.read(buf, 0, buf.length);
System.out.println(new String(buf, 0, bytesRead, StandardCharsets.UTF_8));
Stats stats = stream.stats();
System.out.println("bytes scanned: " + stats.bytesScanned());
System.out.println("bytes processed: " + stats.bytesProcessed());
System.out.println("bytes returned: " + stats.bytesReturned());
stream.close();
bucketName - Name of the bucket.objectName - Object name in the bucket.sqlExpression - SQL expression.is - Input specification of object data.os - Output specification of result.requestProgress - Flag to request progress information.scanStartRange - scan start range of the object.scanEndRange - scan end range of the object.ssec - SSE-C type server-side encryption.SelectResponseStream - Contains filtered records and progress.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic SelectResponseStream selectObjectContent(SelectObjectContentArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
String sqlExpression = "select * from S3Object";
InputSerialization is =
new InputSerialization(null, false, null, null, FileHeaderInfo.USE, null, null,
null);
OutputSerialization os =
new OutputSerialization(null, null, null, QuoteFields.ASNEEDED, null);
SelectResponseStream stream =
minioClient.selectObjectContent(
SelectObjectContentArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.sqlExpression(sqlExpression)
.inputSerialization(is)
.outputSerialization(os)
.requestProgress(true)
.build());
byte[] buf = new byte[512];
int bytesRead = stream.read(buf, 0, buf.length);
System.out.println(new String(buf, 0, bytesRead, StandardCharsets.UTF_8));
Stats stats = stream.stats();
System.out.println("bytes scanned: " + stats.bytesScanned());
System.out.println("bytes processed: " + stats.bytesProcessed());
System.out.println("bytes returned: " + stats.bytesReturned());
stream.close();
args - instance of SelectObjectContentArgsSelectResponseStream - Contains filtered records and progress.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setBucketEncryption(SetBucketEncryptionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.setBucketEncryption(
SetBucketEncryptionArgs.builder().bucket("my-bucketname").config(config).build());
args - SetBucketEncryptionArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic SseConfiguration getBucketEncryption(GetBucketEncryptionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
SseConfiguration config =
minioClient.getBucketEncryption(
GetBucketEncryptionArgs.builder().bucket("my-bucketname").build());
args - GetBucketEncryptionArgs object.SseConfiguration - Server-side encryption configuration.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteBucketEncryption(DeleteBucketEncryptionArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteBucketEncryption(
DeleteBucketEncryptionArgs.builder().bucket("my-bucketname").build());
args - DeleteBucketEncryptionArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic Tags getBucketTags(GetBucketTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Tags tags =
minioClient.getBucketTags(GetBucketTagsArgs.builder().bucket("my-bucketname").build());
args - GetBucketTagsArgs object.Tags - Tags.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setBucketTags(SetBucketTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Map<String, String> map = new HashMap<>();
map.put("Project", "Project One");
map.put("User", "jsmith");
minioClient.setBucketTags(
SetBucketTagsArgs.builder().bucket("my-bucketname").tags(map).build());
args - SetBucketTagsArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteBucketTags(DeleteBucketTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteBucketTags(DeleteBucketTagsArgs.builder().bucket("my-bucketname").build());
args - DeleteBucketTagsArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic Tags getObjectTags(GetObjectTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Tags tags =
minioClient.getObjectTags(
GetObjectTagsArgs.builder().bucket("my-bucketname").object("my-objectname").build());
args - GetObjectTagsArgs object.Tags - Tags.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setObjectTags(SetObjectTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
Map<String, String> map = new HashMap<>();
map.put("Project", "Project One");
map.put("User", "jsmith");
minioClient.setObjectTags(
SetObjectTagsArgs.builder()
.bucket("my-bucketname")
.object("my-objectname")
.tags((map)
.build());
args - SetObjectTagsArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void deleteObjectTags(DeleteObjectTagsArgs args) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, ServerException, XmlParserException
Example:
minioClient.deleteObjectTags(
DeleteObjectTags.builder().bucket("my-bucketname").object("my-objectname").build());
args - DeleteObjectTagsArgs object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic void setTimeout(long connectTimeout,
long writeTimeout,
long readTimeout)
Example:
minioClient.setTimeout(TimeUnit.SECONDS.toMillis(10), TimeUnit.SECONDS.toMillis(10),
TimeUnit.SECONDS.toMillis(30));
connectTimeout - HTTP connect timeout in milliseconds.writeTimeout - HTTP write timeout in milliseconds.readTimeout - HTTP read timeout in milliseconds.public void ignoreCertCheck()
throws KeyManagementException,
NoSuchAlgorithmException
Example:
minioClient.ignoreCertCheck();
KeyManagementException - thrown to indicate key management error.NoSuchAlgorithmException - thrown to indicate missing of SSL library.public void setAppInfo(String name, String version)
name - Your application name.version - Your application version.public void traceOn(OutputStream traceStream)
traceStream - OutputStream for writing HTTP call tracing.traceOff()public void traceOff()
throws IOException
IOException - upon connection errortraceOn(java.io.OutputStream)public void enableAccelerateEndpoint()
public void disableAccelerateEndpoint()
public void enableDualStackEndpoint()
public void disableDualStackEndpoint()
public void enableVirtualStyleEndpoint()
public void disableVirtualStyleEndpoint()
protected void abortMultipartUpload(String bucketName, String objectName, String uploadId) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.uploadId - Upload ID.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated protected void completeMultipartUpload(String bucketName, String objectName, String uploadId, Part[] parts) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.parts - List of parts.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected ObjectWriteResponse completeMultipartUpload(String bucketName, String region, String objectName, String uploadId, Part[] parts, com.google.common.collect.Multimap<String,String> extraHeaders, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.region - Region of the bucket.objectName - Object name in the bucket.uploadId - Upload ID.parts - List of parts.extraHeaders - Extra headers.extraQueryParams - Extra query parameters.ObjectWriteResponse object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerException@Deprecated protected String createMultipartUpload(String bucketName, String objectName, Map<String,String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.headerMap - Additional headers.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected String createMultipartUpload(String bucketName, String region, String objectName, com.google.common.collect.Multimap<String,String> headers, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.region - Region name of buckets in S3 service.objectName - Object name in the bucket.headers - Request headers.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected DeleteResult deleteObjects(String bucketName, List<DeleteObject> objectList, boolean quiet, boolean bypassGovernanceMode) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectList - List of object names.quiet - Quiet flag.DeleteResult - Contains delete result.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected ListBucketResultV2 listObjectsV2(String bucketName, String region, String delimiter, boolean useUrlEncodingType, String startAfter, int maxKeys, String prefix, String continuationToken, boolean fetchOwner, boolean includeUserMetadata, com.google.common.collect.Multimap<String,String> extraHeaders, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidKeyException, InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException, IOException
protected ListBucketResultV1 listObjectsV1(String bucketName, String region, String delimiter, boolean useUrlEncodingType, String marker, int maxKeys, String prefix, com.google.common.collect.Multimap<String,String> extraHeaders, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
protected ListVersionsResult listObjectVersions(String bucketName, String region, String delimiter, boolean useUrlEncodingType, String keyMarker, int maxKeys, String prefix, String versionIdMarker, com.google.common.collect.Multimap<String,String> extraHeaders, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
@Deprecated protected String putObject(String bucketName, String objectName, Object data, int length, Map<String,String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.data - Object data must be BufferedInputStream, RandomAccessFile, byte[] or String.length - Length of object data.headerMap - Additional headers.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected ObjectWriteResponse putObject(String bucketName, String region, String objectName, Object data, int length, com.google.common.collect.Multimap<String,String> headers, com.google.common.collect.Multimap<String,String> extraQueryParams) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.data - Object data must be BufferedInputStream, RandomAccessFile, byte[] or String.length - Length of object data.headers - Additional headers.extraQueryParams - Additional query parameters if any.ObjectWriteResponse object.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected ListMultipartUploadsResult listMultipartUploads(String bucketName, String delimiter, String keyMarker, Integer maxUploads, String prefix, String uploadIdMarker) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.delimiter - Delimiter.keyMarker - Key marker.maxUploads - Maximum upload information to fetch.prefix - Prefix.uploadIdMarker - Upload ID marker.ListMultipartUploadsResult - Contains uploads information.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected ListPartsResult listParts(String bucketName, String objectName, Integer maxParts, Integer partNumberMarker, String uploadId) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.maxParts - Maximum parts information to fetch.partNumberMarker - Part number marker.uploadId - Upload ID.ListPartsResult - Contains parts information.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected String uploadPart(String bucketName, String objectName, Object data, int length, String uploadId, int partNumber, Map<String,String> headerMap) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.data - Object data must be BufferedInputStream, RandomAccessFile, byte[] or String.length - Length of object data.uploadId - Upload ID.partNumber - Part number.headerMap - Additional headers.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionprotected String uploadPartCopy(String bucketName, String objectName, String uploadId, int partNumber, com.google.common.collect.Multimap<String,String> headers) throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, ServerException, XmlParserException, ErrorResponseException, InternalException, InvalidResponseException
bucketName - Name of the bucket.objectName - Object name in the bucket.uploadId - Upload ID.partNumber - Part number.headers - Source object definitions.ErrorResponseException - thrown to indicate S3 service returned an error response.IllegalArgumentException - throws to indicate invalid argument passed.InsufficientDataException - thrown to indicate not enough data available in InputStream.InternalException - thrown to indicate internal library error.InvalidBucketNameException - thrown to indicate invalid bucket name passed.InvalidKeyException - thrown to indicate missing of HMAC SHA-256 library.InvalidResponseException - thrown to indicate S3 service returned invalid or no error
response.IOException - thrown to indicate I/O error on S3 operation.NoSuchAlgorithmException - thrown to indicate missing of MD5 or SHA-256 digest library.XmlParserException - thrown to indicate XML parsing error.ServerExceptionpublic static MinioClient.Builder builder()