diff --git a/api/src/main/java/io/minio/MinioClient.java b/api/src/main/java/io/minio/MinioClient.java index df9c3ef49..7640c9ebf 100755 --- a/api/src/main/java/io/minio/MinioClient.java +++ b/api/src/main/java/io/minio/MinioClient.java @@ -214,9 +214,9 @@ public class MinioClient { /** * Creates MinIO client object with given endpoint using anonymous access. * - *
Example: - * - *
{@code MinioClient minioClient = new MinioClient("https://play.min.io");}+ *
Example:{@code + * MinioClient minioClient = new MinioClient("https://play.min.io"); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *
Examples: @@ -231,6 +231,8 @@ public class MinioClient { * * 192.168.1.60 * * ::1* + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) * @see #MinioClient(String endpoint, String accessKey, String secretKey, String region) @@ -251,11 +253,13 @@ public MinioClient(String endpoint) throws InvalidEndpointException, InvalidPort /** * Creates MinIO client object with given URL object using anonymous access. * - *
Example: - * - *
{@code MinioClient minioClient = new MinioClient(new URL("https://play.min.io"));}+ *
Example:{@code + * MinioClient minioClient = new MinioClient(new URL("https://play.min.io")); + * }* * @param url Endpoint as {@link URL} object. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(String endpoint, String accessKey, String secretKey) * @see #MinioClient(String endpoint, String accessKey, String secretKey, String region) @@ -276,13 +280,13 @@ public MinioClient(URL url) throws InvalidEndpointException, InvalidPortExceptio /** * Creates MinIO client object with given HttpUrl object using anonymous access. * - *
Example: - * - *
- * {@code MinioClient minioClient = new MinioClient(new HttpUrl.parse("https://play.min.io"));} - *+ *
Example:{@code + * MinioClient minioClient = new MinioClient(new HttpUrl.parse("https://play.min.io")); + * }* * @param url Endpoint as {@link HttpUrl} object. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -304,10 +308,10 @@ public MinioClient(HttpUrl url) throws InvalidEndpointException, InvalidPortExce /** * Creates MinIO client object with given endpoint, access key and secret key. * - *
Example: - * - *
{@code MinioClient minioClient = new MinioClient("https://play.min.io", - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");}+ *
Example:{@code + * MinioClient minioClient = new MinioClient("https://play.min.io", + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *
Examples: @@ -324,6 +328,8 @@ public MinioClient(HttpUrl url) throws InvalidEndpointException, InvalidPortExce * * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(URL url, String accessKey, String secretKey) @@ -346,10 +352,10 @@ public MinioClient(String endpoint, String accessKey, String secretKey) /** * Creates MinIO client object with given endpoint, access key, secret key and region name. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("https://play.min.io", - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", "us-west-1");}+ *Example:{@code + * MinioClient minioClient = new MinioClient("https://play.min.io", + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", "us-west-1"); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Examples: @@ -367,6 +373,8 @@ public MinioClient(String endpoint, String accessKey, String secretKey) * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. * @param region Region name of buckets in S3 service. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(URL url, String accessKey, String secretKey) @@ -395,14 +403,14 @@ public MinioClient(String endpoint, String accessKey, String secretKey, String r /** * Creates MinIO client object with given URL object, access key and secret key. * - *Example: - * *
{@code MinioClient minioClient = new MinioClient(new URL("https://play.min.io"), * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");}* * @param url Endpoint as {@link URL} object. * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -424,14 +432,16 @@ public MinioClient(URL url, String accessKey, String secretKey) /** * Creates MinIO client object with given URL object, access key and secret key. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient(HttpUrl.parse("https://play.min.io"), - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");}+ *Example:{@code + * MinioClient minioClient = new MinioClient(HttpUrl.parse("https://play.min.io"), + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); + * }* * @param url Endpoint as {@link HttpUrl} object. * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -454,10 +464,10 @@ public MinioClient(HttpUrl url, String accessKey, String secretKey) /** * Creates MinIO client object with given endpoint, port, access key and secret key. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("play.min.io", 9000, - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");}+ *Example:{@code + * MinioClient minioClient = new MinioClient("play.min.io", 9000, + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Examples: @@ -475,6 +485,8 @@ public MinioClient(HttpUrl url, String accessKey, String secretKey) * @param port TCP/IP port number between 1 and 65535. Unused if endpoint is an URL. * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -502,10 +514,10 @@ public MinioClient(String endpoint, int port, String accessKey, String secretKey * Creates MinIO client object with given endpoint, access key and secret key using secure (TLS) * connection. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("play.min.io", - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);}+ *Example:{@code + * MinioClient minioClient = new MinioClient("play.min.io", + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Examples: @@ -523,6 +535,8 @@ public MinioClient(String endpoint, int port, String accessKey, String secretKey * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. * @param secure Flag to indicate to use secure (TLS) connection to S3 service or not. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -545,10 +559,10 @@ public MinioClient(String endpoint, String accessKey, String secretKey, boolean * Creates MinIO client object using given endpoint, port, access key, secret key and secure (TLS) * connection. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("play.min.io", 9000, - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);}+ *Example:{@code + * MinioClient minioClient = new MinioClient("play.min.io", 9000, + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Examples: @@ -567,6 +581,8 @@ public MinioClient(String endpoint, String accessKey, String secretKey, boolean * @param accessKey Access key (aka user ID) of your account in S3 service. * @param secretKey Secret Key (aka password) of your account in S3 service. * @param secure Flag to indicate to use secure (TLS) connection to S3 service or not. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -588,10 +604,10 @@ public MinioClient(String endpoint, int port, String accessKey, String secretKey * Creates MinIO client object using given endpoint, port, access key, secret key, region and * secure (TLS) connection. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("play.min.io", 9000, - * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true);}+ *Example:{@code + * MinioClient minioClient = new MinioClient("play.min.io", 9000, + * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true); + * }* * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Examples: @@ -611,6 +627,8 @@ public MinioClient(String endpoint, int port, String accessKey, String secretKey * @param secretKey Secret Key (aka password) of your account in S3 service. * @param region Region name of buckets in S3 service. * @param secure Flag to indicate to use secure (TLS) connection to S3 service or not. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -631,11 +649,11 @@ public MinioClient( * Creates MinIO client object using given endpoint, port, access key, secret key, region and * secure (TLS) connection. * - *Example: - * - *
{@code MinioClient minioClient = new MinioClient("play.min.io", 9000, + ** * @param endpoint Endpoint is an URL, domain name, IPv4 or IPv6 address of S3 service. *Example:{@code + * MinioClient minioClient = new MinioClient("play.min.io", 9000, * "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", true, - * customHttpClient);}+ * customHttpClient); + * }Examples: @@ -656,6 +674,8 @@ public MinioClient( * @param region Region name of buckets in S3 service. * @param secure Flag to indicate to use secure (TLS) connection to S3 service or not. * @param httpClient Customized HTTP client object. + * @throws InvalidEndpointException thrown to indicate invalid endpoint passed. + * @throws InvalidPortException thrown to indicate invalid port passed. * @see #MinioClient(String endpoint) * @see #MinioClient(URL url) * @see #MinioClient(String endpoint, String accessKey, String secretKey) @@ -853,7 +873,7 @@ private HttpUrl buildUrl( String objectName, String region, MultimapqueryParamMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException { + throws IllegalArgumentException, InvalidBucketNameException, NoSuchAlgorithmException { if (bucketName == null && objectName != null) { throw new InvalidBucketNameException( NULL_STRING, "null bucket name for object '" + objectName + "'"); @@ -928,8 +948,8 @@ private String getHostHeader(HttpUrl url) { private Request createRequest( HttpUrl url, Method method, Multimap headerMap, Object body, int length) - throws NoSuchAlgorithmException, IllegalArgumentException, IOException, - InsufficientDataException, InternalException { + throws IllegalArgumentException, InsufficientDataException, InternalException, IOException, + NoSuchAlgorithmException { Request.Builder requestBuilder = new Request.Builder(); requestBuilder.url(url); @@ -1024,9 +1044,9 @@ private Response execute( Multimap queryParamMap, Object body, int length) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { boolean traceRequestBody = false; if (body != null && !(body instanceof InputStream @@ -1201,9 +1221,9 @@ private Response execute( Map queryParamMap, Object body, int length) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Multimap headerMultiMap = null; if (headerMap != null) { headerMultiMap = Multimaps.forMap(normalizeHeaders(headerMap)); @@ -1220,9 +1240,9 @@ private Response execute( /** Updates Region cache for given bucket. */ private void updateRegionCache(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if (bucketName != null && this.accessKey != null && this.secretKey != null @@ -1252,9 +1272,9 @@ private void updateRegionCache(String bucketName) /** Returns region of given bucket either from region cache or set in constructor. */ private String getRegion(String bucketName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IllegalArgumentException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { String region; if (this.region == null || "".equals(this.region)) { updateRegionCache(bucketName); @@ -1270,9 +1290,9 @@ private Response executeGet( String objectName, Map headerMap, Map queryParamMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return execute( Method.GET, bucketName, @@ -1286,9 +1306,9 @@ private Response executeGet( private Response executeGet( String bucketName, String objectName, Multimap queryParamMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return execute( Method.GET, bucketName, objectName, getRegion(bucketName), null, queryParamMap, null, 0); } @@ -1298,9 +1318,9 @@ private Response executeHead( String objectName, Map headerMap, Map queryParamMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Response response = execute( Method.HEAD, @@ -1316,9 +1336,9 @@ private Response executeHead( } private Response executeHead(String bucketName, String objectName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { try { return executeHead(bucketName, objectName, null, null); } catch (ErrorResponseException e) { @@ -1332,17 +1352,17 @@ private Response executeHead(String bucketName, String objectName) } private Response executeHead(String bucketName, String objectName, Map headerMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return executeHead(bucketName, objectName, headerMap, null); } private Response executeDelete( String bucketName, String objectName, Map queryParamMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Response response = execute( Method.DELETE, @@ -1363,9 +1383,9 @@ private Response executePost( Map headerMap, Map queryParamMap, Object data) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return execute( Method.POST, bucketName, @@ -1385,9 +1405,9 @@ private Response executePut( Map queryParamMap, Object data, int length) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return execute( Method.PUT, bucketName, objectName, region, headerMap, queryParamMap, data, length); } @@ -1399,75 +1419,71 @@ private Response executePut( Map queryParamMap, Object data, int length) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return executePut( bucketName, objectName, getRegion(bucketName), headerMap, queryParamMap, data, length); } /** - * Returns meta data information of given object in given bucket. + * Gets object information and metadata of an object. * - * Example: + *
Example:{@code + * ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname"); + * }* - *{@code ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname");} - *- * - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @return Populated object meta data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @return Populated object information and metadata. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. * @see ObjectStat */ public ObjectStat statObject(String bucketName, String objectName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, InvalidResponseException, IllegalArgumentException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return statObject(bucketName, objectName, null); } /** - * Returns meta data information of given object in given bucket. - * - *Example: + * Gets object information and metadata of a SSE-C encrypted object. * - *
- * {@code ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname", sse);} - *+ *Example:{@code + * ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname", ssec); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param sse SSE-C type of server-side encryption. - * @return Populated object meta data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param sse SSE-C type server-side encryption. + * @return Populated object information and metadata. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. * @see ObjectStat */ public ObjectStat statObject(String bucketName, String objectName, ServerSideEncryption sse) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkReadRequestSse(sse); checkBucketName(bucketName); checkObjectName(objectName); @@ -1486,205 +1502,201 @@ public ObjectStat statObject(String bucketName, String objectName, ServerSideEnc } /** - * Gets object's URL in given bucket. The URL is ONLY useful to retrieve the object's data if the - * object has public read permissions. - * - *Example: + * Gets URL of an object useful when this object has public read access. * - *
{@code String url = minioClient.getObjectUrl("my-bucketname", "my-objectname");}+ *Example:{@code + * String url = minioClient.getObjectUrl("my-bucketname", "my-objectname"); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @return string contains URL to download the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String getObjectUrl(String bucketName, String objectName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkObjectName(objectName); HttpUrl url = buildUrl(Method.GET, bucketName, objectName, getRegion(bucketName), null); return url.toString(); } /** - * Gets entire object's data as {@link InputStream} in given bucket. The InputStream must be - * closed after use else the connection will remain open. + * Gets data of an object. Returned {@link InputStream} must be closed after use to release + * network resources. * - *Example: - * - *
{@code InputStream stream = minioClient.getObject("my-bucketname", "my-objectname");} - *+ *Example:{@code + * try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname")) { + * // Read data from stream + * } + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @return {@link InputStream} containing the object data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @return {@link InputStream} containing object data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public InputStream getObject(String bucketName, String objectName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return getObject(bucketName, objectName, null, null, null); } /** - * Gets entire object's data as {@link InputStream} in given bucket. The InputStream must be - * closed after use else the connection will remain open. - * - *Example: + * Gets data of a SSE-C encrypted object. Returned {@link InputStream} must be closed after use to + * release network resources. * - *
{@code InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", sse);} - *+ *Example:{@code + * try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", ssec)) { + * // Read data from stream + * } + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param sse Encryption metadata only required for SSE-C. - * @return {@link InputStream} containing the object data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param sse SSE-C type server-side encryption. + * @return {@link InputStream} containing object data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public InputStream getObject(String bucketName, String objectName, ServerSideEncryption sse) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return getObject(bucketName, objectName, null, null, sse); } /** - * Gets object's data starting from given offset as {@link InputStream} in the given bucket. The - * InputStream must be closed after use else the connection will remain open. - * - *Example: + * Gets data from offset of an object. Returned {@link InputStream} must be closed after use to + * release network resources. * - *
- * {@code InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L);} - *+ *Example:{@code + * try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L)) { + * // Read data from stream + * } + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param offset Offset to read at. - * @return {@link InputStream} containing the object's data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param offset Start byte position of object data. + * @return {@link InputStream} containing object data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public InputStream getObject(String bucketName, String objectName, long offset) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return getObject(bucketName, objectName, offset, null, null); } /** - * Gets object's data of given offset and length as {@link InputStream} in the given bucket. The - * InputStream must be closed after use else the connection will remain open. - * - *Example: + * Gets data from offset to length of an object. Returned {@link InputStream} must be closed after + * use to release network resources. * - *
- * {@code InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L);} - *+ *Example:{@code + * try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L)) { + * // Read data from stream + * } + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param offset Offset to read at. - * @param length Length to read. - * @return {@link InputStream} containing the object's data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param offset Start byte position of object data. + * @param length Number of bytes of object data from offset. + * @return {@link InputStream} containing object data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public InputStream getObject(String bucketName, String objectName, long offset, Long length) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { return getObject(bucketName, objectName, offset, length, null); } /** - * Gets object's data of given offset and length as {@link InputStream} in the given bucket. The - * InputStream must be closed after use else the connection will remain open. - * - *Example: + * Gets data from offset to length of a SSE-C encrypted object. Returned {@link InputStream} must + * be closed after use to release network resources. * - *
- * {@code InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L, sse);} - *+ *Example:{@code + * try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L, ssec)) { + * // Read data from stream + * } + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param offset Offset to read at. - * @param length Length to read. - * @param sse Server side encryption. - * @return {@link InputStream} containing the object's data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param offset Start byte position of object data. + * @param length Number of bytes of object data from offset. + * @param sse SSE-C type server-side encryption. + * @return {@link InputStream} containing object data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public InputStream getObject( String bucketName, String objectName, Long offset, Long length, ServerSideEncryption sse) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } @@ -1725,64 +1737,62 @@ public InputStream getObject( } /** - * Gets object's data in the given bucket and stores it to given file name. + * Downloads data of an object to file. * - *Example: + *
Example:{@code + * minioClient.getObject("my-bucketname", "my-objectname", "my-object-file"); + * }* - *{@code minioClient.getObject("my-bucketname", "my-objectname", "photo.jpg");}- * - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param fileName file name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param fileName Name of the file. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void getObject(String bucketName, String objectName, String fileName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { getObject(bucketName, objectName, null, fileName); } /** - * Gets encrypted object's data in the given bucket and stores it to given file name. - * - *Example: + * Downloads data of a SSE-C encrypted object to file. * - *
{@code minioClient.getObject("my-bucketname", "my-objectname", sse, "photo.jpg");}+ *Example:{@code + * minioClient.getObject("my-bucketname", "my-objectname", ssec, "my-object-file"); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param sse encryption metadata. - * @param fileName file name to download into. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param sse SSE-C type server-side encryption. + * @param fileName Name of the file. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void getObject( String bucketName, String objectName, ServerSideEncryption sse, String fileName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkReadRequestSse(sse); Path filePath = Paths.get(fileName); @@ -1867,36 +1877,49 @@ public void getObject( } /** - * Copy a source object into a new object with the provided name in the provided bucket. - * optionally can take a key value CopyConditions and server side encryption as well for - * conditionally attempting copyObject. - * - *Example: - * - *
- * {@code minioClient.copyObject("my-bucketname", "my-objectname", headers, sse, "my-srcbucketname","my-srcobjname", srcSse, copyConditions);} - *- * - * @param bucketName Destination bucket name. - * @param objectName Destination object name. - * @param headerMap Destination object custom metadata. - * @param sse Server side encryption of destination object. + * Creates an object by server-side copying data from another object. + * + *Example:{@code + * // 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); + * }+ * + * @param bucketName Name of the bucket. + * @param objectName Object name to be created. + * @param headerMap (Optional) User metadata. + * @param sse (Optional) Server-side encryption. * @param srcBucketName Source bucket name. - * @param srcObjectName Source object name. - * @param srcSse Server side encryption of source object. - * @param copyConditions CopyConditions object with collection of supported CopyObject conditions. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param srcObjectName (Optional) Source object name. + * @param srcSse (Optional) SSE-C type server-side encryption of source object. + * @param copyConditions (Optional) Conditiions to be used in copy operation. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void copyObject( String bucketName, @@ -1907,9 +1930,9 @@ public void copyObject( String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) - throws InvalidKeyException, InvalidBucketNameException, NoSuchAlgorithmException, - InsufficientDataException, ErrorResponseException, InternalException, IOException, - XmlParserException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } @@ -1956,31 +1979,41 @@ public void copyObject( } /** - * Create an object by concatenating a list of source objects using server-side copying. + * Creates an object by combining data from different source objects using server-side copy. * - *Example: + *
Example:{@code + * List* * @param bucketName Destination Bucket to be created upon compose. * @param objectName Destination Object to be created upon compose. * @param sources List of Source Objects used to compose Object. * @param headerMap User Meta data. * @param sse Server Side Encryption. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void composeObject( String bucketName, @@ -1988,9 +2021,9 @@ public void composeObject( ListsourceObjectList = new ArrayList (); + * 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")); * - * - * {@code minioClient.composeObject("my-bucketname", "my-objectname", composeSources, userMetaData, sse);} - *+ * // 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); + * }sources, Map headerMap, ServerSideEncryption sse) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } @@ -2199,9 +2232,9 @@ private String uploadPartCopy( String uploadId, int partNumber, Map headerMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); queryParamMap.put("partNumber", Integer.toString(partNumber)); queryParamMap.put("uploadId", uploadId); @@ -2213,35 +2246,32 @@ private String uploadPartCopy( } /** - * Returns a presigned URL string with given HTTP method, expiry time and custom request params - * for a specific object in the bucket. - * - * Example: + * Gets presigned URL of an object for HTTP method, expiry time and custom request parameters. * - *
- * {@code String url = minioClient.getPresignedObjectUrl(Method.DELETE, "my-bucketname", "my-objectname", 60 * 60 * 24, reqParams);} - *+ *Example:{@code + * String url = minioClient.getPresignedObjectUrl(Method.DELETE, "my-bucketname", "my-objectname", 24 * 60 * 60, + * reqParams); + * }* - * @param method HTTP {@link Method}. - * @param bucketName Bucket name. + * @param method HTTP {@link Method} to generate presigned URL. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param expires Expiration time in seconds of presigned URL. - * @param reqParams Override values for set of response headers. Currently supported request - * parameters are [response-expires, response-content-type, response-cache-control, - * response-content-disposition] - * @return string contains URL to download the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * @param expires Expiry in seconds; defaults to 7 days. + * @param reqParams Request parameters to override. Supported headers are response-expires, + * response-content-type, response-cache-control and response-content-disposition. + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String getPresignedObjectUrl( Method method, @@ -2249,10 +2279,10 @@ public String getPresignedObjectUrl( String objectName, Integer expires, MapreqParams) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { // Validate input. if (expires < 1 || expires > DEFAULT_EXPIRY_TIME) { throw new InvalidExpiresRangeException( @@ -2280,186 +2310,174 @@ public String getPresignedObjectUrl( } /** - * Returns an presigned URL to download the object in the bucket with given expiry time with - * custom request params. + * Gets presigned URL of an object to download its data for expiry time and request parameters. * - * Example: + *
Example:{@code + * // 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); + * }* - *- * {@code String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 60 * 60 * 24, reqParams);} - *- * - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param expires Expiration time in seconds of presigned URL. - * @param reqParams Override values for set of response headers. Currently supported request - * parameters are [response-expires, response-content-type, response-cache-control, - * response-content-disposition] - * @return string contains URL to download the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * @param expires Expiry in seconds; defaults to 7 days. + * @param reqParams Request parameters to override. Supported headers are response-expires, + * response-content-type, response-cache-control and response-content-disposition. + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String presignedGetObject( String bucketName, String objectName, Integer expires, MapreqParams) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return getPresignedObjectUrl(Method.GET, bucketName, objectName, expires, reqParams); } /** - * Returns an presigned URL to download the object in the bucket with given expiry time. - * - * Example: + * Gets presigned URL of an object to download its data for expiry time. * - *
- * {@code String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 60 * 60 * 24);} - *+ *Example:{@code + * // Get presigned URL to download my-objectname data with one day expiry. + * String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 24 * 60 * 60); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @param expires Expiration time in seconds of presigned URL. - * @return string contains URL to download the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * @param expires Expiry in seconds; defaults to 7 days. + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String presignedGetObject(String bucketName, String objectName, Integer expires) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return presignedGetObject(bucketName, objectName, expires, null); } /** - * Returns an presigned URL to download the object in the bucket with default expiry time. Default - * expiry time is 7 days in seconds. + * Gets presigned URL of an object to download its data for 7 days. * - *Example: + *
Example:{@code + * String url = minioClient.presignedGetObject("my-bucketname", "my-objectname"); + * }* - *{@code String url = minioClient.presignedGetObject("my-bucketname", "my-objectname");} - *- * - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @return string contains URL to download the object - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String presignedGetObject(String bucketName, String objectName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return presignedGetObject(bucketName, objectName, DEFAULT_EXPIRY_TIME, null); } /** - * Returns a presigned URL to upload an object in the bucket with given expiry time. - * - *Example: - * - *
- * {@code String url = minioClient.presignedPutObject("my-bucketname", "my-objectname", 60 * 60 * 24);} - *- * - * @param bucketName Bucket name - * @param objectName Object name in the bucket - * @param expires Expiration time in seconds to presigned URL. - * @return string contains URL to upload the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * Gets presigned URL of an object to upload data for expiry time. + * + *Example:{@code + * // Get presigned URL to upload data to my-objectname with one day expiry. + * String url = minioClient.presignedPutObject("my-bucketname", "my-objectname", 24 * 60 * 60); + * }+ * + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param expires Expiry in seconds; defaults to 7 days. + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String presignedPutObject(String bucketName, String objectName, Integer expires) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return getPresignedObjectUrl(Method.PUT, bucketName, objectName, expires, null); } /** - * Returns a presigned URL to upload an object in the bucket with default expiry time. Default - * expiry time is 7 days in seconds. - * - *Example: + * Gets presigned URL of an object to upload data for 7 days. * - *
{@code String url = minioClient.presignedPutObject("my-bucketname", "my-objectname");} - *+ *Example:{@code + * String url = minioClient.presignedPutObject("my-bucketname", "my-objectname"); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @return string contains URL to upload the object. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidExpiresRangeException upon input expires is out of range - * @throws InvalidResponseException upon a non-xml response from server + * @return URL string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String presignedPutObject(String bucketName, String objectName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidExpiresRangeException, - InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return presignedPutObject(bucketName, objectName, DEFAULT_EXPIRY_TIME); } /** - * Returns string map for given {@link PostPolicy} to upload object with various post policy - * conditions. - * - *Example: + * Gets form-data of {@link PostPolicy} of an object to upload its data using POST method. * - *
- * {@code PostPolicy policy = new PostPolicy("my-bucketname", "my-objectname", ZonedDateTime.now().plusDays(7)); + ** * @param policy Post policy of an object. - * @return Map of strings to construct form-data. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @return key/value pairs to construct form-data. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidExpiresRangeException thrown to indicate invalid expiry duration passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. * @see PostPolicy */ public MapExample:{@code + * PostPolicy policy = new PostPolicy("my-bucketname", "my-objectname", ZonedDateTime.now().plusDays(7)); * * // 'my-objectname' should be 'image/png' content type * policy.setContentType("image/png"); @@ -2474,57 +2492,58 @@ public String presignedPutObject(String bucketName, String objectName) * for (Map.Entry+ * System.out.println(" -F file=@/tmp/userpic.png https://play.min.io/my-bucketname"); + * }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");} presignedPostPolicy(PostPolicy policy) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidExpiresRangeException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { return policy.formData(this.accessKey, this.secretKey, getRegion(policy.bucketName())); } /** - * Removes an object from a bucket. + * Removes an object. * - * Example: + *
Example:{@code + * minioClient.removeObject("my-bucketname", "my-objectname"); + * }* - *{@code minioClient.removeObject("my-bucketname", "my-objectname");}- * - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void removeObject(String bucketName, String objectName) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } @@ -2538,9 +2557,9 @@ public void removeObject(String bucketName, String objectName) * Do DeleteObjects as per https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html */ private ListremoveObject(String bucketName, List objectList) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); queryParamMap.put("delete", ""); @@ -2571,12 +2590,11 @@ private List removeObject(String bucketName, List obj } /** - * Removes multiple objects from a bucket. As objects removal are lazily executed, its required to - * iterate the returned Iterable. - * - * Example: + * Removes multiple objects lazily. Its required to iterate the returned Iterable to perform + * removal. * - *
{@code List* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectNames List of Object names in the bucket. * @return (lazy) Iterable of the Result DeleteErrors. */ @@ -2697,17 +2716,17 @@ public void remove() { } /** - * Lists object information in given bucket. + * Lists object information of a bucket. * - *myObjectNames = new LinkedList (); + * Example:{@code + * List+ * } + * }myObjectNames = new LinkedList (); * objectNames.add("my-objectname1"); * objectNames.add("my-objectname2"); * objectNames.add("my-objectname3"); @@ -2584,9 +2602,10 @@ private List removeObject(String bucketName, List obj * for (Result result : results) { * DeleteError error = errorResult.get(); * System.out.println("Error in deleting object " + error.objectName() + "; " + error.message()); - * }} Example: - * - *
{@code Iterable* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @return an iterator of Result Items. * @throws XmlParserException upon parsing response xml */ @@ -2716,19 +2735,18 @@ public Iterable> results = minioClient.listObjects("my-bucketname"); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listObjects("my-bucketname"); * for (Result - result : results) { * Item item = result.get(); * System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName()); - * }}
> listObjects(final String bucketName) throws XmlPar } /** - * Lists object information in given bucket and prefix. + * Lists object information of a bucket for prefix. * - * Example: - * - *
- * {@code Iterable* - * @param bucketName Bucket name. - * @param prefix Prefix string. List objects whose name starts with `prefix`. + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. * @return an iterator of Result Items. * @throws XmlParserException upon parsing response xml */ @@ -2739,23 +2757,19 @@ public Iterable> results = minioClient.listObjects("my-bucketname", "my-obj"); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listObjects("my-bucketname", "my-obj"); * for (Result - result : results) { * Item item = result.get(); * System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName()); - * }}
> listObjects(final String bucketName, final String } /** - * Lists object information as {@code Iterable - } in given bucket, prefix and - * recursive flag. + * Lists object information of a bucket for prefix recursively. * - *
Example: - * - *
- * {@code Iterable* - * @param bucketName Bucket name. - * @param prefix Prefix string. List objects whose name starts with `prefix`. - * @param recursive when false, emulates a directory structure where each listing returned is - * either a full object or part of the object's key up to the first '/'. All objects wit the - * same prefix up to the first '/' will be merged into one entry. + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. + * @param recursive List recursively than directory structure emulation. * @return an iterator of Result Items. * @see #listObjects(String bucketName) * @see #listObjects(String bucketName, String prefix) @@ -2767,25 +2781,20 @@ public Iterable> results = minioClient.listObjects("my-bucketname", "my-obj", true); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listObjects("my-bucketname", "my-obj", true); * for (Result - result : results) { * Item item = result.get(); * System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName()); - * }}
> listObjects( } /** - * Lists object information as {@code Iterable - } in given bucket, prefix, recursive - * flag and S3 API version to use. + * Lists object information of a bucket for prefix recursively using S3 API version 1. * - *
Example: - * - *
- * {@code Iterable+ * + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. + * @param recursive List recursively than directory structure emulation. + * @param useVersion1 when true, version 1 of REST API is used. * @return an iterator of Result Items. * @see #listObjects(String bucketName) * @see #listObjects(String bucketName, String prefix) @@ -2800,27 +2809,23 @@ public Iterable> results = minioClient.listObjects("my-bucketname", "my-obj", true, true); + * Example:{@code + * Iterable- * - * @param bucketName Bucket name. - * @param prefix Prefix string. List objects whose name starts with `prefix`. - * @param recursive when false, emulates a directory structure where each listing returned is - * either a full object or part of the object's key up to the first '/'. All objects wit the - * same prefix up to the first '/' will be merged into one entry. - * @param useVersion1 If set, Amazon AWS S3 List Object V1 is used, else List Object V2 is used as - * default. + * } + * }> results = minioClient.listObjects("my-bucketname", "my-obj", true, true); * for (Result - result : results) { * Item item = result.get(); * System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName()); - * }}
> listObjects( } /** - * Lists object information as {@code Iterable - } in given bucket, prefix, recursive - * flag, user metadata flag and S3 API version to use. - * - *
Example: + * Lists object information with user metadata of a bucket for prefix recursively using S3 API + * version 1. * - *
- * {@code Iterable* - * @param bucketName Bucket name. - * @param prefix Prefix string. List objects whose name starts with `prefix`. - * @param recursive when false, emulates a directory structure where each listing returned is - * either a full object or part of the object's key up to the first '/'. All objects wit the - * same prefix up to the first '/' will be merged into one entry. + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. + * @param recursive List recursively than directory structure emulation. * @param includeUserMetadata include user metadata of each object. This is MinIO specific * extension to ListObjectsV2. - * @param useVersion1 If set, Amazon AWS S3 List Object V1 is used, else List Object V2 is used as - * default. + * @param useVersion1 when true, version 1 of REST API is used. * @return an iterator of Result Items. * @see #listObjects(String bucketName) * @see #listObjects(String bucketName, String prefix) @@ -2986,9 +2991,9 @@ private ListBucketResult listObjectsV2( String prefix, String delimiter, boolean includeUserMetadata) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map> results = minioClient.listObjects("my-bucketname", "my-obj", true, true, false); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listObjects("my-bucketname", "my-obj", true, true, false); * for (Result - result : results) { * Item item = result.get(); * System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName()); - * }}
queryParamMap = new HashMap<>(); queryParamMap.put("list-type", "2"); @@ -3155,9 +3160,9 @@ public void remove() { /** Do ListObjects as per https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html */ private ListBucketResultV1 listObjectsV1( String bucketName, String marker, String prefix, String delimiter) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); if (marker != null) { @@ -3184,31 +3189,32 @@ private ListBucketResultV1 listObjectsV1( } /** - * Returns all bucket information owned by the current user. - * - * Example: + * Lists bucket information of all buckets. * - *
{@code List+ * + * @return List of Bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public ListbucketList = minioClient.listBuckets(); + * Example:{@code + * List- * - * @return List of bucket type. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * } + * }bucketList = minioClient.listBuckets(); * for (Bucket bucket : bucketList) { * System.out.println(bucket.creationDate() + ", " + bucket.name()); - * }} listBuckets() - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Response response = executeGet(null, null, (Multimap ) null); try (ResponseBody body = response.body()) { ListAllMyBucketsResult result = @@ -3218,34 +3224,35 @@ public List listBuckets() } /** - * Checks if given bucket exist and is having read access. - * - * Example: + * Checks if a bucket exists. * - *
{@code boolean found = minioClient.bucketExists("my-bucketname"); + *+ * + * @param bucketName Name of the bucket. + * @return True if the bucket exists. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public boolean bucketExists(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { try { executeHead(bucketName, null); return true; @@ -3261,85 +3268,84 @@ public boolean bucketExists(String bucketName) /** * Creates a bucket with default region. * - *Example:{@code + * boolean found = minioClient.bucketExists("my-bucketname"); * if (found) { * System.out.println("my-bucketname exists"); * } else { * System.out.println("my-bucketname does not exist"); - * }}- * - * @param bucketName Bucket name. - * @return True if the bucket exists and the user has at least read access. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * } + * }Example: - * - *
{@code boolean found = minioClient.makeBucket("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws RegionConflictException upon passed region conflicts with the one previously specified - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution. - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + *Example:{@code + * minioClient.makeBucket("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void makeBucket(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, RegionConflictException, - NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { this.makeBucket(bucketName, null, false); } /** * Creates a bucket with given region. * - *Example: - * - *
{@code boolean found = minioClient.makeBucket("my-bucketname", "eu-west-1");}- * - * @param bucketName Bucket name. - * @param region region in which the bucket will be created. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws RegionConflictException upon passed region conflicts with the one previously specified. - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + *Example:{@code + * minioClient.makeBucket("my-bucketname", "eu-west-1"); + * }+ * + * @param bucketName Name of the bucket. + * @param region Region in which the bucket will be created. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void makeBucket(String bucketName, String region) - throws InvalidBucketNameException, IllegalArgumentException, RegionConflictException, - NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { this.makeBucket(bucketName, region, false); } /** - * Creates a bucket with given region and object lock option. - * - *Example: - * - *
{@code boolean found = minioClient.makeBucket("my-bucketname", "eu-west-2", true);}- * - * @param bucketName Bucket name. - * @param region region in which the bucket will be created. - * @param objectLock enable object lock support. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws RegionConflictException upon passed region conflicts with the one previously specified. - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + * Creates a bucket with object lock feature enabled. + * + *Example:{@code + * minioClient.makeBucket("my-bucketname", "eu-west-2", true); + * }+ * + * @param bucketName Name of the bucket. + * @param region Region in which the bucket will be created. + * @param objectLock Flag to enable object lock feature. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void makeBucket(String bucketName, String region, boolean objectLock) - throws InvalidBucketNameException, IllegalArgumentException, RegionConflictException, - NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { // If region param is not provided, set it with the one provided by constructor if (region == null) { region = this.region; @@ -3371,28 +3377,29 @@ public void makeBucket(String bucketName, String region, boolean objectLock) } /** - * Enable object versioning in given bucket. - * - *Example: - * - *
{@code minioClient.enableVersioning("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + * Enables object versioning feature in a bucket. + * + *Example:{@code + * minioClient.enableVersioning("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void enableVersioning(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); String config = @@ -3403,28 +3410,29 @@ public void enableVersioning(String bucketName) } /** - * Disable object versioning in given bucket. - * - * Example: - * - *
{@code minioClient.disableVersioning("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + * Disables object versioning feature in a bucket. + * + *Example:{@code + * minioClient.disableVersioning("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void disableVersioning(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("versioning", ""); String config = @@ -3435,30 +3443,32 @@ public void disableVersioning(String bucketName) } /** - * Sets default object retention in given bucket. - * - * Example: + * Sets default object retention in a bucket. * - *
{@code minioClient.setDefaultRetention("my-bucketname", config);}+ *Example:{@code + * ObjectLockConfiguration config = + * new ObjectLockConfiguration(RetentionMode.COMPLIANCE, new RetentionDurationDays(100)); + * minioClient.setDefaultRetention("my-bucketname", config); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param config Object lock configuration. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void setDefaultRetention(String bucketName, ObjectLockConfiguration config) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("object-lock", ""); @@ -3467,31 +3477,33 @@ public void setDefaultRetention(String bucketName, ObjectLockConfiguration confi } /** - * Gets default object retention in given bucket. - * - * Example: - * - *
- * {@code ObjectLockConfiguration config = minioClient.getDefaultRetention("my-bucketname");} - *- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Gets default object retention in a bucket. + * + *Example:{@code + * // bucket must be created with object lock enabled. + * minioClient.makeBucket("my-bucketname", null, true); + * ObjectLockConfiguration config = minioClient.getDefaultRetention("my-bucketname"); + * System.out.println("Mode: " + config.mode()); + * System.out.println("Duration: " + config.duration().duration() + " " + config.duration().unit()); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public ObjectLockConfiguration getDefaultRetention(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("object-lock", ""); @@ -3503,30 +3515,29 @@ public ObjectLockConfiguration getDefaultRetention(String bucketName) } /** - * Applies object retention lock onto an object. + * Sets retention configuration to an object. * - * Example: + *
Example:{@code + * Retention retention = new Retention(RetentionMode.COMPLIANCE, ZonedDateTime.now().plusYears(1)); + * minioClient.setObjectRetention("my-bucketname", "my-objectname", null, retention, true); + * }* - *{@code minioClient.setObjectRetention("my-bucketname", "my-object", null, config, true);} - *- * - * @param bucketName Bucket name. - * @param objectName Object name. - * @param versionId Object versio id. - * @param config Object lock configuration. - * @param bypassGovernanceRetention By pass governance retention. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server - * @throws IllegalArgumentException upon invalid value is passed to a method. + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param versionId Version ID of the object. + * @param config Object retention configuration. + * @param bypassGovernanceRetention Bypass Governance retention. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void setObjectRetention( String bucketName, @@ -3534,11 +3545,9 @@ public void setObjectRetention( String versionId, Retention config, boolean bypassGovernanceRetention) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException, - IllegalArgumentException { - + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if (config == null) { throw new IllegalArgumentException("null value is not allowed in config."); } @@ -3562,35 +3571,33 @@ public void setObjectRetention( } /** - * Fetches object retention lock of an object. - * - *Example: - * - *
- * {@code Retention retention = s3Client.getObjectRetention("my-bucketname", "my-objectname", null); - * System.out.println("mode: " + retention.mode() + "until: " + retention.retainUntilDate());} - *- * - * @param bucketName Bucket name. - * @param objectName Object name. - * @param versionId Version Id. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Gets retention configuration of an object. + * + *Example:{@code + * Retention retention = minioClient.getObjectRetention("my-bucketname", "my-objectname", null); + * System.out.println("mode: " + retention.mode() + "until: " + retention.retainUntilDate()); + * }+ * + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param versionId Version ID of the object. + * @return Object retention configuration. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public Retention getObjectRetention(String bucketName, String objectName, String versionId) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { - + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("retention", ""); @@ -3607,32 +3614,31 @@ public Retention getObjectRetention(String bucketName, String objectName, String } /** - * Enables object legal hold on an object. - * - * Example: + * Enables legal hold on an object. * - *
{@code minioClient.enableObjectLegalHold("my-bucketname", "my-object", null);}+ *Example:{@code + * minioClient.enableObjectLegalHold("my-bucketname", "my-object", null); + * }* - * @param bucketName Bucket name. - * @param objectName Object name. - * @param versionId Object version id. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param versionId Version ID of the object. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void enableObjectLegalHold(String bucketName, String objectName, String versionId) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { - + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("legal-hold", ""); @@ -3649,32 +3655,31 @@ public void enableObjectLegalHold(String bucketName, String objectName, String v } /** - * Disable object legal hold on an object. + * Disables legal hold on an object. * - * Example: + *
Example:{@code + * minioClient.disableObjectLegalHold("my-bucketname", "my-object", null); + * }* - *{@code minioClient.disableObjectLegalHold("my-bucketname", "my-object", null);}- * - * @param bucketName Bucket name. - * @param objectName Object name. - * @param versionId Object version id. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param versionId Version ID of the object. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void disableObjectLegalHold(String bucketName, String objectName, String versionId) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { - + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("legal-hold", ""); @@ -3691,39 +3696,37 @@ public void disableObjectLegalHold(String bucketName, String objectName, String } /** - * Returns true if the object legal hold is enabled. + * Returns true if legal hold is enabled on an object. * - * Example: - * - *
- * {@code boolean status = s3Client.isObjectLegalHoldEnabled("my-bucketname", "my-objectname", null); + *+ * + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param versionId Version ID of the object. + * @return true if legal hold is enabled. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public boolean isObjectLegalHoldEnabled(String bucketName, String objectName, String versionId) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { - + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapExample:{@code + * 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"); - * }} - *- * - * @param bucketName Bucket name. - * @param objectName Object name. - * @param versionId Object version id. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * } + * }queryParamMap = new HashMap<>(); queryParamMap.put("legal-hold", ""); @@ -3743,27 +3746,27 @@ public boolean isObjectLegalHoldEnabled(String bucketName, String objectName, St /** * Removes an empty bucket. * - * Example: - * - *
{@code minioClient.removeBucket("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InsufficientDataException upon getting EOFException while reading given - * @throws InvalidResponseException upon a non-xml response from server + *Example:{@code + * minioClient.removeBucket("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void removeBucket(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { executeDelete(bucketName, null, null); } @@ -3780,9 +3783,9 @@ private String putObject( MapheaderMap, String uploadId, int partNumber) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = null; if (partNumber > 0 && uploadId != null && !"".equals(uploadId)) { queryParamMap = new HashMap<>(); @@ -3797,9 +3800,9 @@ private String putObject( private void putObject( String bucketName, String objectName, PutObjectOptions options, Object data) - throws InvalidBucketNameException, NoSuchAlgorithmException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, IllegalArgumentException, - InsufficientDataException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map headerMap = new HashMap<>(); if (options.headers() != null) { @@ -3869,38 +3872,33 @@ private void putObject( } /** - * Uploads data from given file as object to given bucket using given PutObjectOptions. If any - * error occurs, partial uploads are aborted. + * Uploads data from a file to an object using {@link PutObjectOptions}. * - * Example: + *
Example:{@code + * minioClient.putObject("my-bucketname", "my-objectname", "my-filename", null); + * }* - *- * {@code PutObjectOptions options = new PutObjectOptions(7003256, -1); - * minioClient.putObject("my-bucketname", "my-objectname", "trip.mp4", options);} - *- * - * @param bucketName Bucket name. - * @param objectName Object name to create in the bucket. + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. * @param filename Name of file to upload. - * @param options Options to be used during object upload. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * @param options {@link PutObjectOptions} to be used during upload. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void putObject( String bucketName, String objectName, String filename, PutObjectOptions options) - throws InvalidBucketNameException, NoSuchAlgorithmException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, IllegalArgumentException, - InsufficientDataException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkBucketName(bucketName); checkObjectName(objectName); @@ -3938,38 +3936,34 @@ public void putObject( } /** - * Uploads data from given stream as object to given bucket using given PutObjectOptions. If any - * error occurs, partial uploads are aborted. - * - *Example: - * - *
- * {@code PutObjectOptions options = new PutObjectOptions(7003256, -1); - * minioClient.putObject("my-bucketname", "my-objectname", inputStream, options);} - *- * - * @param bucketName Bucket name. - * @param objectName Object name to create in the bucket. - * @param stream Stream to upload. - * @param options Options to be used during object upload. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * Uploads data from a stream to an object using {@link PutObjectOptions}. + * + *Example:{@code + * PutObjectOptions options = new PutObjectOptions(7003256, -1); + * minioClient.putObject("my-bucketname", "my-objectname", stream, options); + * }+ * + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. + * @param stream Stream contains object data. + * @param options {@link PutObjectOptions} to be used during upload. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void putObject( String bucketName, String objectName, InputStream stream, PutObjectOptions options) - throws InvalidBucketNameException, NoSuchAlgorithmException, IOException, InvalidKeyException, - XmlParserException, ErrorResponseException, InternalException, IllegalArgumentException, - InsufficientDataException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { checkBucketName(bucketName); checkObjectName(objectName); @@ -3989,33 +3983,32 @@ public void putObject( } /** - * Get JSON string of bucket policy of the given bucket. - * - *Example: - * - *
{@code String config = minioClient.getBucketPolicy("my-bucketname"); - * System.out.println("Bucket policy: " + config);}- * - * @param bucketName the name of the bucket for which policies are to be listed. - * @return bucket policy JSON string. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws BucketPolicyTooLargeException upon bucket policy too large in size - * @throws InvalidResponseException upon a non-xml response from server + * Gets bucket policy configuration of a bucket. + * + *Example:{@code + * String config = minioClient.getBucketPolicy("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @return Bucket policy configuration as JSON string. + * @throws BucketPolicyTooLargeException thrown to indicate returned bucket policy is too large. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String getBucketPolicy(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, BucketPolicyTooLargeException, - InvalidResponseException { + throws BucketPolicyTooLargeException, ErrorResponseException, IllegalArgumentException, + InsufficientDataException, InternalException, InvalidBucketNameException, + InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, + XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("policy", ""); @@ -4059,11 +4052,10 @@ public String getBucketPolicy(String bucketName) } /** - * Set JSON string of policy on given bucket. - * - * Example: + * Sets bucket policy configuration to a bucket. * - *
{@code // Assume policyJson contains below JSON string; + *+ * + * @param bucketName Name of the bucket. + * @param policy Bucket policy configuration as JSON string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void setBucketPolicy(String bucketName, String policy) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapExample:{@code + * // Assume policyJson contains below JSON string; * // { * // "Statement": [ * // { @@ -4085,26 +4077,27 @@ public String getBucketPolicy(String bucketName) * // "Version": "2012-10-17" * // } * // - * minioClient.setBucketPolicy("my-bucketname", policyJson);}- * - * @param bucketName Bucket name. - * @param policy Bucket policy JSON string. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * minioClient.setBucketPolicy("my-bucketname", policyJson); + * }headerMap = new HashMap<>(); headerMap.put("Content-Type", "application/json"); @@ -4116,12 +4109,10 @@ public void setBucketPolicy(String bucketName, String policy) } /** - * Set XML string of LifeCycle on a given bucket. Delete the lifecycle of bucket in case a null is - * passed as lifeCycle. - * - * Example: + * Sets life cycle configuration to a bucket. * - *
{@code // Lets consider variable 'lifeCycleXml' contains below XML String; + *+ * + * @param bucketName Name of the bucket. + * @param lifeCycle Life cycle configuraion as XML string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void setBucketLifeCycle(String bucketName, String lifeCycle) - throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, - IOException, InvalidKeyException, XmlParserException, ErrorResponseException, - InternalException, IllegalArgumentException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((lifeCycle == null) || "".equals(lifeCycle)) { throw new IllegalArgumentException("life cycle cannot be empty"); } @@ -4164,29 +4155,29 @@ public void setBucketLifeCycle(String bucketName, String lifeCycle) } /** - * Delete the LifeCycle of bucket. - * - *Example:{@code + * // Lets consider variable 'lifeCycleXml' contains below XML String; * //- * - * @param bucketName Bucket name. - * @param lifeCycle Bucket policy XML string. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws IllegalArgumentException upon invalid value is passed to a method. - * @throws InvalidResponseException upon a non-xml response from server + * minioClient.setBucketLifecycle("my-bucketname", lifeCycleXml); + * }* // * // - * minioClient.setBucketLifecycle("my-bucketname", lifeCycleXml);}* // * //expire-bucket @@ -4133,27 +4124,27 @@ public void setBucketPolicy(String bucketName, String policy) * //Example: - * - *
{@code deleteBucketLifeCycle("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Deletes life cycle configuration of a bucket. + * + *Example:{@code + * deleteBucketLifeCycle("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void deleteBucketLifeCycle(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("lifecycle", ""); Response response = executeDelete(bucketName, "", queryParamMap); @@ -4194,30 +4185,30 @@ public void deleteBucketLifeCycle(String bucketName) } /** - * Get bucket life cycle configuration. - * - * Example: - * - *
{@code String lifecycle = minioClient.getBucketLifecycle("my-bucketname"); - * System.out.println("Life cycle settings: " + lifecycle);}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Gets life cycle configuration of a bucket. + * + *Example:{@code + * String lifecycle = minioClient.getBucketLifecycle("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @return Life cycle configuration as XML string. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public String getBucketLifeCycle(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("lifecycle", ""); String bodyContent = ""; @@ -4239,31 +4230,30 @@ public String getBucketLifeCycle(String bucketName) } /** - * Get bucket notification configuration - * - * Example: - * - *
- * {@code NotificationConfiguration config = minioClient.getBucketNotification("my-bucketname"); - * System.out.println(config);}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Gets notification configuration of a bucket. + * + *Example:{@code + * NotificationConfiguration config = minioClient.getBucketNotification("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @return {@link NotificationConfiguration} object. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public NotificationConfiguration getBucketNotification(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapqueryParamMap = new HashMap<>(); queryParamMap.put("notification", ""); @@ -4274,11 +4264,10 @@ public NotificationConfiguration getBucketNotification(String bucketName) } /** - * Set bucket notification configuration - * - * Example: + * Sets notification configuration to a bucket. * - *
{@code List+ * + * @param bucketName Name of the bucket. + * @param notificationConfiguration {@link NotificationConfiguration} to be set. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void setBucketNotification( String bucketName, NotificationConfiguration notificationConfiguration) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { MapeventList = new LinkedList<>(); + * Example:{@code + * List- * - * @param bucketName Bucket name. - * @param notificationConfiguration Notification configuration to be set. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * minioClient.setBucketNotification("my-bucketname", config); + * }eventList = new LinkedList<>(); * eventList.add(EventType.OBJECT_CREATED_PUT); * eventList.add(EventType.OBJECT_CREATED_COPY); * @@ -4294,27 +4283,28 @@ public NotificationConfiguration getBucketNotification(String bucketName) * NotificationConfiguration config = new NotificationConfiguration(); * config.setQueueConfigurationList(queueConfigurationList); * - * minioClient.setBucketNotification("my-bucketname", config);} queryParamMap = new HashMap<>(); queryParamMap.put("notification", ""); Response response = @@ -4323,46 +4313,45 @@ public void setBucketNotification( } /** - * Remove all bucket notification. - * - * Example: - * - *
{@code minioClient.removeAllBucketNotification("my-bucketname");}- * - * @param bucketName Bucket name. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * Removes notification configuration of a bucket. + * + *Example:{@code + * minioClient.removeAllBucketNotification("my-bucketname"); + * }+ * + * @param bucketName Name of the bucket. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void removeAllBucketNotification(String bucketName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { NotificationConfiguration notificationConfiguration = new NotificationConfiguration(); setBucketNotification(bucketName, notificationConfiguration); } /** - * Lists incomplete uploads of objects in given bucket. + * Lists incomplete object upload information of a bucket. * - *Example: - * - *
- * {@code Iterable* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @return an iterator of Upload. * @see #listIncompleteUploads(String, String, boolean) */ @@ -4372,19 +4361,18 @@ public Iterable> results = minioClient.listIncompleteUploads("my-bucketname"); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listIncompleteUploads("my-bucketname"); * for (Result result : results) { * Upload upload = result.get(); * System.out.println(upload.uploadId() + ", " + upload.objectName()); - * }} > listIncompleteUploads(String bucketName) } /** - * Lists incomplete uploads of objects in given bucket and prefix. - * - * Example: + * Lists incomplete object upload information of a bucket for prefix. * - *
- * {@code Iterable* - * @param bucketName Bucket name. - * @param prefix filters the list of uploads to include only those that start with prefix. + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. * @return an iterator of Upload. * @throws XmlParserException upon parsing response xml * @see #listIncompleteUploads(String, String, boolean) @@ -4395,22 +4383,19 @@ public Iterable> results = minioClient.listIncompleteUploads("my-bucketname", "my-obj"); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listIncompleteUploads("my-bucketname", "my-obj"); * for (Result result : results) { * Upload upload = result.get(); * System.out.println(upload.uploadId() + ", " + upload.objectName()); - * }} > listIncompleteUploads(String bucketName, String } /** - * Lists incomplete uploads of objects in given bucket, prefix and recursive flag. - * - * Example: + * Lists incomplete object upload information of a bucket for prefix recursively. * - *
- * {@code Iterable* - * @param bucketName Bucket name. - * @param prefix Prefix string. List objects whose name starts with `prefix`. - * @param recursive when false, emulates a directory structure where each listing returned is - * either a full object or part of the object's key up to the first '/'. All uploads with the - * same prefix up to the first '/' will be merged into one entry. + * @param bucketName Name of the bucket. + * @param prefix Object name starts with prefix. + * @param recursive List recursively than directory structure emulation. * @return an iterator of Upload. * @see #listIncompleteUploads(String bucketName) * @see #listIncompleteUploads(String bucketName, String prefix) @@ -4590,9 +4575,9 @@ private ListMultipartUploadsResult listIncompleteUploads( String prefix, String delimiter, int maxUploads) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if (maxUploads < 0 || maxUploads > 1000) { maxUploads = 1000; } @@ -4634,9 +4619,9 @@ private ListMultipartUploadsResult listIncompleteUploads( */ private String initMultipartUpload( String bucketName, String objectName, Map> results = minioClient.listIncompleteUploads("my-bucketname", "my-obj", true); + * Example:{@code + * Iterable+ * } + * }> results = minioClient.listIncompleteUploads("my-bucketname", "my-obj", true); * for (Result result : results) { * Upload upload = result.get(); * System.out.println(upload.uploadId() + ", " + upload.objectName()); - * }} headerMap) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { // set content type if not set already if ((headerMap != null) && (headerMap.get("Content-Type") == null)) { headerMap.put("Content-Type", "application/octet-stream"); @@ -4660,9 +4645,9 @@ private String initMultipartUpload( */ private void completeMultipart( String bucketName, String objectName, String uploadId, Part[] parts) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); queryParamMap.put(UPLOAD_ID, uploadId); CompleteMultipartUpload completeManifest = new CompleteMultipartUpload(parts); @@ -4800,9 +4785,9 @@ public void remove() { /** Do ListParts as per https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html */ private ListPartsResult listObjectParts( String bucketName, String objectName, String uploadId, int partNumberMarker) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); queryParamMap.put(UPLOAD_ID, uploadId); if (partNumberMarker > 0) { @@ -4821,39 +4806,39 @@ private ListPartsResult listObjectParts( * https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html */ private void abortMultipartUpload(String bucketName, String objectName, String uploadId) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Map queryParamMap = new HashMap<>(); queryParamMap.put(UPLOAD_ID, uploadId); executeDelete(bucketName, objectName, queryParamMap); } /** - * Removes incomplete multipart upload of given object. - * - * Example: + * Removes incomplete uploads of an object. * - *
{@code minioClient.removeIncompleteUpload("my-bucketname", "my-objectname");}+ *Example:{@code + * minioClient.removeIncompleteUpload("my-bucketname", "my-objectname"); + * }* - * @param bucketName Bucket name. + * @param bucketName Name of the bucket. * @param objectName Object name in the bucket. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public void removeIncompleteUpload(String bucketName, String objectName) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { for (Resultr : listIncompleteUploads(bucketName, objectName, true, false)) { Upload upload = r.get(); if (objectName.equals(upload.objectName())) { @@ -4864,13 +4849,12 @@ public void removeIncompleteUpload(String bucketName, String objectName) } /** - * Listen to bucket notifications. As bucket notification are lazily executed, its required to - * iterate. The returned closeable iterator must be used with try with resource; else the stream - * will not be closed. - * - * Example: + * Listens events of object prefix and suffix of a bucket. The returned closable iterator is + * lazily evaluated hence its required to iterate to get new records and must be used with + * try-with-resource to release underneath network resources. * - *
{@code String[] events = {"s3:ObjectCreated:*", "s3:ObjectAccessed:*"}; + *+ * + * @param bucketName Name of the bucket. + * @param prefix Listen events of object starts with prefix. + * @param suffix Listen events of object ends with suffix. + * @param events Events to listen. + * @return {@link CloseableIterator} of {@link Result} {@link NotificationRecords}. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public CloseableIteratorExample:{@code + * String[] events = {"s3:ObjectCreated:*", "s3:ObjectAccessed:*"}; * try (CloseableIterator- * - * @param bucketName Bucket name. - * @param prefix Prefix of concerned objects events. - * @param suffix Suffix of concerned objects events. - * @param events List of events to watch. - * @return (lazy) CloseableIterator of event records. + * } + * }> ci = * minioClient.listenBucketNotification("bcketName", "", "", events)) { * while (ci.hasNext()) { @@ -4880,19 +4864,31 @@ public void removeIncompleteUpload(String bucketName, String objectName) * + " for " + event.bucketName() + "/" + event.objectName()); * } * } - * }} > listenBucketNotification( String bucketName, String prefix, String suffix, String[] events) - throws IOException, InvalidKeyException, NoSuchAlgorithmException, InsufficientDataException, - InvalidResponseException, InternalException, InvalidBucketNameException, - XmlParserException, ErrorResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { Multimap queryParamMap = HashMultimap.create(); queryParamMap.put("prefix", prefix); queryParamMap.put("suffix", suffix); @@ -4907,11 +4903,10 @@ public CloseableIterator > listenBucketNotification( } /** - * Select object content using SQL expression. + * Selects content of a object by SQL expression. * - * Example: - * - *
{@code String sqlExpression = "select * from S3Object"; + ** - * @param bucketName Bucket name. - * @param objectName Object name. + * @param bucketName Name of the bucket. + * @param objectName Object name in the bucket. * @param sqlExpression SQL expression. - * @param is Input serialization. - * @param os Output serialization. - * @param requestProgress Request progress in response. - * @param scanStartRange scan start range. - * @param scanEndRange scan end range. - * @param sse Server side encryption. - * @throws InvalidBucketNameException upon invalid bucket name is given - * @throws IllegalArgumentException upon empty object name is given - * @throws NoSuchAlgorithmException upon requested algorithm was not found during signature - * calculation - * @throws InsufficientDataException upon getting EOFException while reading given InputStream - * even before reading given length - * @throws IOException upon connection error - * @throws InvalidKeyException upon an invalid access key or secret key - * @throws XmlParserException upon parsing response xml - * @throws ErrorResponseException upon unsuccessful execution - * @throws InternalException upon internal library error - * @throws InvalidResponseException upon a non-xml response from server + * @param is Input specification of object data. + * @param os Output specification of result. + * @param requestProgress Flag to request progress information. + * @param scanStartRange scan start range of the object. + * @param scanEndRange scan end range of the object. + * @param sse SSE-C type server-side encryption. + * @return {@link SelectResponseStream} contains filtered records and progress. + * @throws ErrorResponseException thrown to indicate S3 service returned an error response. + * @throws IllegalArgumentException throws to indicate invalid argument passed. + * @throws InsufficientDataException thrown to indicate not enough data available in InputStream. + * @throws InternalException thrown to indicate internal library error. + * @throws InvalidBucketNameException thrown to indicate invalid bucket name passed. + * @throws InvalidKeyException thrown to indicate missing of HMAC SHA-256 library. + * @throws InvalidResponseException thrown to indicate S3 service returned invalid or no error + * response. + * @throws IOException thrown to indicate I/O error on S3 operation. + * @throws NoSuchAlgorithmException thrown to indicate missing of MD5 or SHA-256 digest library. + * @throws XmlParserException thrown to indicate XML parsing error. */ public SelectResponseStream selectObjectContent( String bucketName, @@ -4960,9 +4956,9 @@ public SelectResponseStream selectObjectContent( Long scanStartRange, Long scanEndRange, ServerSideEncryption sse) - throws InvalidBucketNameException, IllegalArgumentException, NoSuchAlgorithmException, - InsufficientDataException, IOException, InvalidKeyException, XmlParserException, - ErrorResponseException, InternalException, InvalidResponseException { + throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, + InternalException, InvalidBucketNameException, InvalidKeyException, + InvalidResponseException, IOException, NoSuchAlgorithmException, XmlParserException { if ((bucketName == null) || (bucketName.isEmpty())) { throw new IllegalArgumentException("bucket name cannot be empty"); } @@ -5020,11 +5016,10 @@ private long getAvailableSize(Object data, long expectedReadSize) * Sets HTTP connect, write and read timeouts. A value of 0 means no timeout, otherwise values * must be between 1 and Integer.MAX_VALUE when converted to milliseconds. * - *Example:{@code + * 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, @@ -4926,29 +4921,30 @@ public CloseableIterator+ * stream.close(); + * }> listenBucketNotification( * System.out.println("bytes processed: " + stats.bytesProcessed()); * System.out.println("bytes returned: " + stats.bytesReturned()); * - * stream.close();} Example: - * - *
- * {@code minioClient.setTimeout(TimeUnit.SECONDS.toMillis(10), TimeUnit.SECONDS.toMillis(10), TimeUnit.SECONDS.toMillis(30));} - *+ *Example:{@code + * minioClient.setTimeout(TimeUnit.SECONDS.toMillis(10), TimeUnit.SECONDS.toMillis(10), + * TimeUnit.SECONDS.toMillis(30)); + * }* * @param connectTimeout HTTP connect timeout in milliseconds. * @param writeTimeout HTTP write timeout in milliseconds. @@ -5043,12 +5038,15 @@ public void setTimeout(long connectTimeout, long writeTimeout, long readTimeout) /** * Ignores check on server certificate for HTTPS connection. * - *Example: + *
Example:{@code + * minioClient.ignoreCertCheck(); + * }* - *{@code minioClient.ignoreCertCheck();}+ * @throws KeyManagementException thrown to indicate key management error. + * @throws NoSuchAlgorithmException thrown to indicate missing of SSL library. */ @SuppressFBWarnings(value = "SIC", justification = "Should not be used in production anyways.") - public void ignoreCertCheck() throws NoSuchAlgorithmException, KeyManagementException { + public void ignoreCertCheck() throws KeyManagementException, NoSuchAlgorithmException { final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { diff --git a/docs/API.md b/docs/API.md index 49b72f609..86ae7e882 100644 --- a/docs/API.md +++ b/docs/API.md @@ -243,10 +243,10 @@ All APIs throw below exceptions in addition to specific to API. | Exception | Cause | |:---------------------------|:---------------------------------------------------------------------| | ErrorResponseException | Thrown to indicate S3 service returned an error response. | -| IllegalArgumentException | Throws to indicate invalid argument is 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 is passed. | +| 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. | @@ -273,11 +273,11 @@ __Parameters__ __Example__ ```java // Check whether 'my-bucketname' exists or not. -boolean found = minioClient.bucketExists("mybucket"); +boolean found = minioClient.bucketExists("my-bucketname"); if (found) { - System.out.println("mybucket exists"); + System.out.println("my-bucketname exists"); } else { - System.out.println("mybucket does not exist"); + System.out.println("my-bucketname does not exist"); } ``` @@ -285,7 +285,7 @@ if (found) { ### deleteBucketLifeCycle(String bucketName) `private void deleteBucketLifeCycle(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#deleteBucketLifeCycle-java.lang.String-)_ -Delete the lifecycle of the bucket. +Deletes life cycle configuration of a bucket. __Parameters__ | Parameter | Type | Description | @@ -301,7 +301,7 @@ minioClient.deleteBucketLifeCycle("my-bucketname"); ### disableVersioning(String bucketName) `public void disableVersioning(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#disableVersioning-java.lang.String-)_ -Object versioning is disabled in bucketName. +Disables object versioning feature in a bucket. __Parameters__ | Parameter | Type | Description | @@ -317,7 +317,7 @@ minioClient.disableVersioning("my-bucketname"); ### enableVersioning(String bucketName) `public void enableVersioning(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#enableVersioning-java.lang.String-)_ -Object versioning is enabled in bucketName. +Enables object versioning feature in a bucket. __Parameters__ @@ -334,16 +334,16 @@ minioClient.enableVersioning("my-bucketname"); ### getBucketLifeCycle(String bucketName) `public String getBucketLifeCycle(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getBucketLifeCycle-java.lang.String-)_ -Get the lifecycle of the bucket. +Gets life cycle configuration of a bucket. __Parameters__ | Parameter | Type | Description | |:---------------|:---------|:--------------------| | ``bucketName`` | _String_ | Name of the bucket. | -| Returns | -|:--------------------------------------------| -| _String_: contains lifecycle configuration. | +| Returns | +|:--------------------------------------------------| +| _String_: Life cycle configuration as XML string. | __Example__ ```java @@ -355,7 +355,7 @@ System.out.println("Life cycle settings: " + lifecycle); ### getBucketNotification(String bucketName) `public NotificationConfiguration getBucketNotification(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getBucketNotification-java.lang.String-)_ -Get bucket notification configuration. +Gets notification configuration of a bucket. __Parameters__ | Parameter | Type | Description | @@ -369,14 +369,13 @@ __Parameters__ __Example__ ```java NotificationConfiguration config = minioClient.getBucketNotification("my-bucketname"); -System.out.println(config); ``` ### getBucketPolicy(String bucketName) `public String getBucketPolicy(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getBucketPolicy-java.lang.String-)_ -Get bucket policy for a bucket. +Gets bucket policy configuration of a bucket. __Parameters__ | Parameter | Type | Description | @@ -384,21 +383,20 @@ __Parameters__ | ``bucketName`` | _String_ | Name of the bucket. | -| Returns | -|:-------------------------------------| -| _String_: Bucket policy JSON string. | +| Returns | +|:------------------------------------------------------| +| _String_: Bucket policy configuration as JSON string. | __Example__ ```java -String config = minioClient.getBucketPolicy("myBucket"); -System.out.println("Bucket policy: " + config); +String config = minioClient.getBucketPolicy("my-bucketname"); ``` ### getDefaultRetention(String bucketName) `public ObjectLockConfiguration getDefaultRetention(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getDefaultRetention-java.lang.String-)_ -Get default retention of bucket. +Gets default object retention in a bucket. __Parameters__ @@ -413,8 +411,8 @@ __Parameters__ __Example__ ```java // bucket must be created with object lock enabled. -s3Client.makeBucket("my-bucketname", null, true); -ObjectLockConfiguration config = s3Client.getDefaultRetention("my-bucketname"); +minioClient.makeBucket("my-bucketname", null, true); +ObjectLockConfiguration config = minioClient.getDefaultRetention("my-bucketname"); System.out.println("Mode: " + config.mode()); System.out.println("Duration: " + config.duration().duration() + " " + config.duration().unit()); ``` @@ -423,11 +421,11 @@ System.out.println("Duration: " + config.duration().duration() + " " + config.du ### listBuckets() `public ListlistBuckets()` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listBuckets--)_ -Lists all buckets. +Lists bucket information of all buckets. -| Returns | -|:------------------------------------------| -| _List<[Bucket]>_ : List of Bucket object. | +| Returns | +|:-----------------------------------| +| _List<[Bucket]>_ : List of Bucket. | __Example__ ```java @@ -441,7 +439,7 @@ for (Bucket bucket : bucketList) { ### listenBucketNotification(String bucketName, String prefix, String suffix, String[] events) `public CloseableIterator > listenBucketNotification(String bucketName, String prefix, String suffix, String[] events)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listenBucketNotification-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-)_ -Listen events of object prefix and suffix in bucket. +Listens events of object prefix and suffix of a bucket. The returned closable iterator is lazily evaluated hence its required to iterate to get new records and must be used with try-with-resource to release underneath network resources. __Parameters__ | Parameter | Type | Description | @@ -474,7 +472,7 @@ try (CloseableIterator > ci = ### listIncompleteUploads(String bucketName) `public Iterable > listIncompleteUploads(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listIncompleteUploads-java.lang.String-)_ -Lists partially uploaded objects in a bucket. +Lists incomplete object upload information of a bucket. __Parameters__ | Parameter | Type | Description | @@ -498,13 +496,13 @@ for (Result result : results) { ### listIncompleteUploads(String bucketName, String prefix) `public Iterable > listIncompleteUploads(String bucketName, String prefix)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listIncompleteUploads-java.lang.String-java.lang.String-)_ -Lists incomplete uploads of objects in given bucket and prefix. +Lists incomplete object upload information of a bucket for prefix. __Parameters__ -| Parameter | Type | Description | -|:---------------|:---------|:---------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``prefix`` | _String_ | List objects starts with prefix. | +| Parameter | Type | Description | +|:---------------|:---------|:--------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``prefix`` | _String_ | Object name starts with prefix. | | Returns | |:-------------------------------------------------------| @@ -523,14 +521,14 @@ for (Result result : results) { ### listIncompleteUploads(String bucketName, String prefix, boolean recursive) `public Iterable > listIncompleteUploads(String bucketName, String prefix, boolean recursive)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listIncompleteUploads-java.lang.String-java.lang.String-boolean-)_ -Lists partially uploaded objects in a bucket. +Lists incomplete object upload information of a bucket for prefix recursively. __Parameters__ -| Param | Type | Description | -|:---------------|:----------|:---------------------------------------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``prefix`` | _String_ | List objects starts with prefix. | -| ``recursive`` | _boolean_ | List objects recursively; else emulates a directory structure. | +| Param | Type | Description | +|:---------------|:----------|:-----------------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``prefix`` | _String_ | Object name starts with prefix. | +| ``recursive`` | _boolean_ | List recursively than directory structure emulation. | | Returns | |:-------------------------------------------------------| @@ -549,7 +547,7 @@ for (Result result : results) { ### listObjects(String bucketName) `public Iterable > listObjects(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listObjects-java.lang.String-)_ -Lists object information in given bucket. +Lists object information of a bucket. __Parameters__ | Parameter | Type | Description | @@ -573,13 +571,13 @@ for (Result - result : results) { ### listObjects(String bucketName, String prefix) `public Iterable
> listObjects(String bucketName, String prefix))` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listObjects-java.lang.String-java.lang.String-)_ -Lists object information in given bucket and prefix. +Lists object information of a bucket for prefix. __Parameters__ -| Parameter | Type | Description | -|:---------------|:---------|:---------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``prefix`` | _String_ | List objects starts with prefix. | +| Parameter | Type | Description | +|:---------------|:---------|:--------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``prefix`` | _String_ | Object name starts with prefix. | | Returns | |:-----------------------------------------------------------| @@ -598,14 +596,14 @@ for (Result - result : results) { ### listObjects(String bucketName, String prefix, boolean recursive) `public Iterable
> listObjects(String bucketName, String prefix, boolean recursive)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listObjects-java.lang.String-java.lang.String-boolean-)_ -Lists object information as Iterable - in given bucket, prefix and recursive flag. +Lists object information of a bucket for prefix recursively. __Parameters__ -| Parameter | Type | Description | -|:---------------|:----------|:---------------------------------------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``prefix`` | _String_ | List objects starts with prefix. | -| ``recursive`` | _boolean_ | List objects recursively; else emulates a directory structure. | +| Parameter | Type | Description | +|:---------------|:----------|:-----------------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``prefix`` | _String_ | Object name starts with prefix. | +| ``recursive`` | _boolean_ | List recursively than directory structure emulation. | | Returns | |:-----------------------------------------------------------| @@ -624,15 +622,15 @@ for (Result
- result : results) { ### listObjects(String bucketName, String prefix, boolean recursive, boolean useVersion1) `public Iterable
> listObjects(String bucketName, String prefix, boolean recursive, boolean useVersion1)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#listObjects-java.lang.String-java.lang.String-boolean-boolean-)_ -Lists all objects in a bucket. +Lists object information of a bucket for prefix recursively using S3 API version 1. __Parameters__ -| Parameter | Type | Description | -|:----------------|:----------|:---------------------------------------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``prefix`` | _String_ | List objects starts with prefix. | -| ``recursive`` | _boolean_ | List objects recursively; else emulates a directory structure. | -| ``useVersion1`` | _boolean_ | when true, version 1 of REST API is used. | +| Parameter | Type | Description | +|:----------------|:----------|:-----------------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``prefix`` | _String_ | Object name starts with prefix. | +| ``recursive`` | _boolean_ | List recursively than directory structure emulation. | +| ``useVersion1`` | _boolean_ | when true, version 1 of REST API is used. | | Returns | |:-----------------------------------------------------------| @@ -651,7 +649,7 @@ for (Result - result : results) { ### makeBucket(String bucketName) `public void makeBucket(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#makeBucket-java.lang.String-)_ -Creates a new bucket with default region. +Creates a bucket with default region. __Parameters__ | Parameter | Type | Description | @@ -667,7 +665,7 @@ minioClient.makeBucket("my-bucketname"); ### makeBucket(String bucketName, String region) `public void makeBucket(String bucketName, String region)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#makeBucket-java.lang.String-java.lang.String-)_ -Creates a new bucket with given region. +Creates a bucket with given region. __Parameters__ | Parameter | Type | Description | @@ -684,14 +682,14 @@ minioClient.makeBucket("my-bucketname", "eu-west-1"); ### makeBucket(String bucketName, String region, boolean objectLock) `public void makeBucket(String bucketName, String region, boolean objectLock)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#makeBucket-java.lang.String-java.lang.String-boolean-)_ -Creates a new bucket with object lock functionality enabled. +Creates a bucket with object lock feature enabled. __Parameters__ -| Parameter | Type | Description | -|:---------------|:----------|:-----------------------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``region`` | _String_ | Region in which the bucket will be created. | -| ``objectLock`` | _boolean_ | Create bucket with object lock feature or not. | +| Parameter | Type | Description | +|:---------------|:----------|:-------------------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``region`` | _String_ | (Optional) Region in which the bucket will be created. | +| ``objectLock`` | _boolean_ | Flag to enable object lock feature. | __Example__ ```java @@ -702,9 +700,7 @@ minioClient.makeBucket("my-bucketname", "us-west-2", true); ### removeAllBucketNotification(String bucketName) `public void removeAllBucketNotification(String bucketName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#removeAllBucketNotification-java.lang.String-)_ -Remove all notification configuration from a bucket. - -[View Javadoc](http://minio.github.io/minio-java/io/minio/MinioClient.html#removeAllBucketNotification-java.lang.String) +Removes notification configuration of a bucket. __Parameters__ | Parameter | Type | Description | @@ -736,7 +732,7 @@ minioClient.removeBucket("my-bucketname"); ### removeIncompleteUpload(String bucketName, String objectName) `public void removeIncompleteUpload(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#removeIncompleteUpload-java.lang.String-java.lang.String-)_ -Removes a partially uploaded object. +Removes incomplete uploads of an object. __Parameters__ | Parameter | Type | Description | @@ -753,7 +749,7 @@ minioClient.removeIncompleteUpload("my-bucketname", "my-objectname"); ### setBucketLifeCycle(String bucketName, String lifeCycle) `public void setBucketLifeCycle(String bucketName, String lifeCycle)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setBucketLifeCycle-java.lang.String-java.lang.String-)_ -Set a life cycle on bucket. +Sets life cycle configuration to a bucket. __Parameters__ | Parameter | Type | Description | @@ -782,7 +778,7 @@ minioClient.setBucketLifecycle("my-bucketname", lifeCycleXml); ### setBucketNotification(String bucketName, NotificationConfiguration notificationConfiguration) `public void setBucketNotification(String bucketName, NotificationConfiguration notificationConfiguration)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setBucketNotification-java.lang.String-io.minio.messages.NotificationConfiguration-)_ -Set bucket notification configuration. +Sets notification configuration to a bucket. __Parameters__ @@ -816,14 +812,14 @@ minioClient.setBucketNotification("my-bucketname", config); ### setBucketPolicy(String bucketName, String policy) `public void setBucketPolicy(String bucketName, String policy)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setBucketPolicy-java.lang.String-java.lang.String-)_ -Set a policy on bucket. +Sets bucket policy configuration to a bucket. __Parameters__ -| Parameter | Type | Description | -|:---------------|:---------|:------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``policy`` | _String_ | Bucket policy as JSON string. | +| Parameter | Type | Description | +|:---------------|:---------|:--------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``policy`` | _String_ | Bucket policy configuration as JSON string. | __Example__ ```java @@ -856,7 +852,7 @@ minioClient.setBucketPolicy("my-bucketname", policyJson); ### setDefaultRetention(String bucketName, ObjectLockConfiguration config) `public void setDefaultRetention(String bucketName, ObjectLockConfiguration config)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setDefaultRetention-java.lang.String-io.minio.messages.ObjectLockConfiguration-)_ -Set default retention on bucket. +Sets default object retention in a bucket. __Parameters__ | Parameter | Type | Description | @@ -877,7 +873,7 @@ minioClient.setDefaultRetention("my-bucketname", config); ### composeObject(String bucketName, String objectName, List
sources, Map headerMap, ServerSideEncryption sse) `public void composeObject(String bucketName, String objectName, List sources, Map headerMap, ServerSideEncryption sse)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#composeObject-java.lang.String-java.lang.String-java.util.List-java.util.Map-io.minio.ServerSideEncryption-)_ - Creates a new Object by combining different source objects. +Creates an object by combining data from different source objects using server-side copy. __Parameters__ | Param | Type | Description | @@ -894,31 +890,58 @@ List sourceObjectList = new ArrayList (); 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); ``` ### copyObject(String bucketName, String objectName, Map headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions) `public void copyObject(String bucketName, String objectName, Map headerMap, ServerSideEncryption sse, String srcBucketName, String srcObjectName, ServerSideEncryption srcSse, CopyConditions copyConditions)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#copyObject-java.lang.String-java.lang.String-java.util.Map-io.minio.ServerSideEncryption-java.lang.String-java.lang.String-io.minio.ServerSideEncryption-io.minio.CopyConditions-)_ -Create object by copying from source object in source bucket. +Creates an object by server-side copying data from another object. __Parameters__ -| Parameter | Type | Description | -|:-------------------|:-------------------------|:-------------------------------------------| -| ``bucketName`` | _String_ | Bucket name. | -| ``objectName`` | _String_ | Object name to be created. | -| ``headerMap`` | _Map _ | (Optional) User metadata. | -| ``sse`` | _[ServerSideEncryption]_ | (Optional) Server-side encryption. | -| ``srcBucketName`` | _String_ | Source bucket name. | -| ``srcObjectName`` | _String_ | (Optional) Source object name. | -| ``srcSse`` | _[ServerSideEncryption]_ | (Optional) Source Server-side encryption. | -| ``copyConditions`` | _[CopyConditions]_ | (Optional) Conditiions to be used to copy. | +| Parameter | Type | Description | +|:-------------------|:-------------------------|:---------------------------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectName`` | _String_ | Object name to be created. | +| ``headerMap`` | _Map _ | (Optional) User metadata. | +| ``sse`` | _[ServerSideEncryption]_ | (Optional) Server-side encryption. | +| ``srcBucketName`` | _String_ | Source bucket name. | +| ``srcObjectName`` | _String_ | (Optional) Source object name. | +| ``srcSse`` | _[ServerSideEncryption]_ | (Optional) SSE-C type server-side encryption of source object. | +| ``copyConditions`` | _[CopyConditions]_ | (Optional) Conditiions to be used in copy operation. | __Example__ ```java -minioClient.copyObject("my-bucketname", "my-objectname", null, null, "my-source-bucketname", null, null, null); +// 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); ``` @@ -949,7 +972,7 @@ Enables legal hold on an object. | Parameter | Type | Description | |:---------------|:---------|:---------------------------| | ``bucketName`` | _String_ | Name of the bucket. | -| ``objectName`` | _String_ | Object name to be created. | +| ``objectName`` | _String_ | Object name in the bucket. | | ``versionId`` | _String_ | Version ID of the object. | __Example__ @@ -961,7 +984,7 @@ minioClient.enableObjectLegalHold("my-bucketname", "my-objectname", null); ### getObject(String bucketName, String objectName) `public InputStream getObject(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-)_ -Downloads an object as a stream. +Gets data of an object. Returned `InputStream` must be closed after use to release network resources. __Parameters__ | Parameter | Type | Description | @@ -975,14 +998,16 @@ __Parameters__ __Example__ ```java -InputStream stream = minioClient.getObject("my-bucketname", "my-objectname"); +try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname")) { + // Read data from stream +} ``` ### getObject(String bucketName, String objectName, long offset) `public InputStream getObject(String bucketName, String objectName, long offset)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-long-)_ -Gets object's data starting from given offset as InputStream in the given bucket. The InputStream must be closed after use else the connection will remain open. +Gets data from offset of an object. Returned `InputStream` must be closed after use to release network resources. __Parameters__ | Parameter | Type | Description | @@ -997,14 +1022,16 @@ __Parameters__ __Example__ ```java -InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L); +try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L)) { + // Read data from stream +} ``` ### getObject(String bucketName, String objectName, long offset, Long length) `public InputStream getObject(String bucketName, String objectName, long offset, Long length)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-long-java.lang.Long-)_ -Downloads the specified range bytes of an object as a stream. +Gets data from offset to length of an object. Returned {@link InputStream} must be closed after use to release network resources. __Parameters__ | Parameter | Type | Description | @@ -1020,21 +1047,23 @@ __Parameters__ __Example__ ```java -InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L); +try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L)) { + // Read data from stream +} ``` ### getObject(String bucketName, String objectName, ServerSideEncryption sse) `public InputStream getObject(String bucketName, String objectName, ServerSideEncryption sse)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-io.minio.ServerSideEncryption-)_ -Gets entire server-side encrypted object's data as InputStream in given bucket. The InputStream must be closed after use else the connection will remain open. +Gets data of a SSE-C encrypted object. Returned {@link InputStream} must be closed after use to release network resources. __Parameters__ -| Parameter | Type | Description | -|:---------------|:-------------------------|:---------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``objectName`` | _String_ | Object name in the bucket. | -| ``sse`` | _[ServerSideEncryption]_ | Server-side encryption. | +| Parameter | Type | Description | +|:---------------|:-------------------------|:-----------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectName`` | _String_ | Object name in the bucket. | +| ``sse`` | _[ServerSideEncryption]_ | SSE-C type server-side encryption. | | Returns | |:---------------------------------------------------| @@ -1042,21 +1071,23 @@ __Parameters__ __Example__ ```java -InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", sse); +try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", ssec)) { + // Read data from stream +} ``` ### getObject(String bucketName, String objectName, Long offset, Long length, ServerSideEncryption sse) `public InputStream getObject(String bucketName, String objectName, Long offset, Long length, ServerSideEncryption sse)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-java.lang.Long-java.lang.Long-io.minio.ServerSideEncryption-)_ -Gets specified range bytes of server-side encrypted object's data as InputStream in given bucket. The InputStream must be closed after use else the connection will remain open. +Gets data from offset to length of a SSE-C encrypted object. Returned {@link InputStream} must be closed after use to release network resources. __Parameters__ | Parameter | Type | Description | |:---------------|:-------------------------|:-------------------------------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``offset`` | _long_ | Start byte position of object data. | +| ``offset`` | _Long_ | (Optional) Start byte position of object data. | | ``length`` | _Long_ | (Optional) Number of bytes of object data from offset. | | ``sse`` | _[ServerSideEncryption]_ | (Optional) Server-side encryption. | @@ -1066,21 +1097,23 @@ __Parameters__ __Example__ ```java -InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L, sse); +try (InputStream stream = minioClient.getObject("my-bucketname", "my-objectname", 1024L, 4096L, ssec)) { + // Read data from stream +} ``` ### getObject(String bucketName, String objectName, String fileName) `public void getObject(String bucketName, String objectName, String fileName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObject-java.lang.String-java.lang.String-java.lang.String-)_ -Downloads object in bucket to given file name. +Downloads data of an object to file. __Parameters__ | Parameter | Type | Description | |:---------------|:---------|:---------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``fileName`` | _String_ | File name. | +| ``fileName`` | _String_ | Name of the file. | __Example__ ```java @@ -1094,38 +1127,38 @@ minioClient.getObject("my-bucketname", "my-objectname", "my-object-file"); Downloads server-side encrypted object in bucket to given file name. __Parameters__ -| Parameter | Type | Description | -|:---------------|:-------------------------|:---------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``objectName`` | _String_ | Object name in the bucket. | -| ``sse`` | _[ServerSideEncryption]_ | Server-side encryption. | -| ``fileName`` | _String_ | File name. | +| Parameter | Type | Description | +|:---------------|:-------------------------|:-----------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectName`` | _String_ | Object name in the bucket. | +| ``sse`` | _[ServerSideEncryption]_ | SSE-C type server-side encryption. | +| ``fileName`` | _String_ | Name of the file. | __Example__ ```java -minioClient.getObject("my-bucketname", "my-objectname", sse, "my-object-file"); +minioClient.getObject("my-bucketname", "my-objectname", ssec, "my-object-file"); ``` ### getObjectRetention(String bucketName, String objectName, String versionId) `public Retention getObjectRetention(String bucketName, String objectName, String versionId)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObjectRetention-java.lang.String-java.lang.String-java.lang.String-)_ -Returns retention set on a given object. +Gets retention configuration of an object. __Parameters__ | Parameter | Type | Description | |:---------------|:---------|:---------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``versionId`` | _String_ | Object Version. | +| ``versionId`` | _String_ | Version ID of the object. | -| Returns | -|:--------------------------------| -| _[Retention]_: Retention object | +| Returns | +|:-----------------------------------------------| +| _[Retention]_: object retention configuration. | __Example__ ```java -Retention retention = s3Client.getObjectRetention("my-bucketname", "my-objectname", null); +Retention retention = minioClient.getObjectRetention("my-bucketname", "my-objectname", null); System.out.println("mode: " + retention.mode() + "until: " + retention.retainUntilDate()); ``` @@ -1133,7 +1166,7 @@ System.out.println("mode: " + retention.mode() + "until: " + retention.retainUnt ### getObjectUrl(String bucketName, String objectName) `public String getObjectUrl(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getObjectUrl-java.lang.String-java.lang.String-)_ -Gets object's URL in given bucket. +Gets URL of an object useful when this object has public read access. __Parameters__ | Parameter | Type | Description | @@ -1147,7 +1180,7 @@ Gets object's URL in given bucket. __Example__ ```java -String url = client.getObjectUrl("my-bucketname", "my-objectname"); +String url = minioClient.getObjectUrl("my-bucketname", "my-objectname"); System.out.println("my-bucketname/my-objectname can be downloaded by " + url); ``` @@ -1155,15 +1188,15 @@ System.out.println("my-bucketname/my-objectname can be downloaded by " + url); ### getPresignedObjectUrl(Method method, String bucketName, String objectName, Integer expires, Map reqParams) `public String getPresignedObjectUrl(Method method, String bucketName, String objectName, Integer expires, Map reqParams)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#getPresignedObjectUrl-io.minio.http.Method-java.lang.String-java.lang.String-java.lang.Integer-java.util.Map-)_ -Returns a presigned URL string with given HTTP method, expiry time and custom request params for a specific object in the bucket. +Gets presigned URL of an object for HTTP method, expiry time and custom request parameters. __Parameters__ | Parameter | Type | Description | |:---------------|:---------------------|:---------------------------------------| -| ``method`` | _Method_ | HTTP method to generate presigned URL. | +| ``method`` | _[Method]_ | HTTP method to generate presigned URL. | | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``expiry`` | _Integer_ | Expiry in seconds; defaults to 7 days. | +| ``expires`` | _Integer_ | Expiry in seconds; defaults to 7 days. | | ``reqParams`` | _Map _ | Request parameters to override. | | Returns | @@ -1172,21 +1205,22 @@ Returns a presigned URL string with given HTTP method, expiry time and custom re __Example__ ```java -String url = getPresignedObjectUrl(Method.PUT, "my-bucketname", null, null, null); -System.out.println("my-bucketname can be created by " + url); +String url = minioClient.getPresignedObjectUrl(Method.DELETE, "my-bucketname", "my-objectname", 24 * 60 * 60, + reqParams); ``` + ### isObjectLegalHoldEnabled(String bucketName, String objectName, String versionId) `public boolean isObjectLegalHoldEnabled(String bucketName, String objectName, String versionId)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#isObjectLegalHoldEnabled-java.lang.String-java.lang.String-java.lang.String-)_ -Returns true if object legal hold is enabled. +Returns true if legal hold is enabled on an object. __Parameters__ | Parameter | Type | Description | |:---------------|:---------|:---------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``versionId`` | _String_ | Object Version. | +| ``versionId`` | _String_ | Version ID of the object. | | Returns | |:------------------------------------------| @@ -1194,7 +1228,7 @@ Returns true if object legal hold is enabled. __Example__ ```java -boolean status = s3Client.isObjectLegalHoldEnabled("my-bucketname", "my-objectname", null); +boolean status = minioClient.isObjectLegalHoldEnabled("my-bucketname", "my-objectname", null); if (status) { System.out.println("Legal hold is on"); else { @@ -1206,7 +1240,7 @@ else { ### presignedGetObject(String bucketName, String objectName) `public String presignedGetObject(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedGetObject-java.lang.String-java.lang.String-)_ -Returns an presigned URL to download the object in the bucket with default expiry time. Default expiry time is 7 days in seconds. +Gets presigned URL of an object to download its data for 7 days. __Parameters__ | Parameter | Type | Description | @@ -1221,7 +1255,6 @@ __Parameters__ __Example__ ```java String url = minioClient.presignedGetObject("my-bucketname", "my-objectname"); -System.out.println("my-bucketname/my-objectname can be downloaded by " + url); ``` @@ -1229,14 +1262,14 @@ System.out.println("my-bucketname/my-objectname can be downloaded by " + url); ### presignedGetObject(String bucketName, String objectName, Integer expires) `public String presignedGetObject(String bucketName, String objectName, Integer expires)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedGetObject-java.lang.String-java.lang.String-java.lang.Integer-)_ -Generates a presigned URL for HTTP GET operations. Browsers/Mobile clients may point to this URL to directly download objects even if the bucket is private. This presigned URL can have an associated expiration time in seconds after which it is no longer operational. The default expiry is set to 7 days. +Gets presigned URL of an object to download its data for expiry time. __Parameters__ | Parameter | Type | Description | |:---------------|:----------|:----------------------------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``expiry`` | _Integer_ | Expiry in seconds. Default expiry is set to 7 days. | +| ``expires`` | _Integer_ | Expiry in seconds. Default expiry is set to 7 days. | | Returns | |:---------------------------------------------| @@ -1244,22 +1277,22 @@ __Parameters__ __Example__ ```java -String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 60 * 60 * 24); -System.out.println("my-bucketname/my-objectname can be downloaded by " + url); +// Get presigned URL to download my-objectname data with one day expiry. +String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 24 * 60 * 60); ``` ### presignedGetObject(String bucketName, String objectName, Integer expires, Map reqParams) `public String presignedGetObject(String bucketName, String objectName, Integer expires, Map reqParams)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedGetObject-java.lang.String-java.lang.String-java.lang.Integer-java.util.Map-)_ -Returns an presigned URL to download the object in the bucket with given expiry time with custom request params. +Gets presigned URL of an object to download its data for expiry time and request parameters. __Parameters__ | Parameter | Type | Description | |:---------------|:---------------------|:---------------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``expiry`` | _Integer_ | Expiry in seconds; defaults to 7 days. | +| ``expires`` | _Integer_ | Expiry in seconds; defaults to 7 days. | | ``reqParams`` | _Map _ | Request parameters to override. | | Returns | @@ -1268,15 +1301,15 @@ __Parameters__ __Example__ ```java -String url = minioClient.presignedGetObject("my-bucketname", "my-objectname", 60 * 60 * 24, reqParams); -System.out.println("my-bucketname/my-objectname can be downloaded by " + url); +// 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); ``` ### presignedPostPolicy(PostPolicy policy) `public Map presignedPostPolicy(PostPolicy policy)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedPostPolicy-io.minio.PostPolicy-)_ -Allows setting policy conditions to a presigned URL for POST operations. Policies such as bucket name to receive object uploads, key name prefixes, expiry policy may be set. The client receives HTTP status code under key success_action_status, when the file is uploaded successfully. If its value is set to 201, the client notifies with a XML document containing the key where the file was uploaded to. +Gets form-data of [PostPolicy] of an object to upload its data using POST method. __Parameters__ | Parameter | Type | Description | @@ -1284,8 +1317,8 @@ __Parameters__ | ``policy`` | _[PostPolicy]_ | Post policy of an object. | -| Returns | -|:----------------------------------------------------------------| +| Returns | +|:---------------------------------------------------------------| | _Map _: key/value pairs to construct form-data. | __Example__ @@ -1312,7 +1345,7 @@ System.out.println(" -F file=@/tmp/userpic.png https://play.min.io/my-bucketname ### presignedPutObject(String bucketName, String objectName) `public String presignedPutObject(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedPutObject-java.lang.String-java.lang.String-)_ -Returns a presigned URL to upload an object in the bucket with default expiry time. Default expiry time is 7 days in seconds. +Gets presigned URL of an object to upload data for 7 days. __Parameters__ | Parameter | Type | Description | @@ -1327,21 +1360,20 @@ __Parameters__ __Example__ ```java String url = minioClient.presignedPutObject("my-bucketname", "my-objectname"); -System.out.println("my-bucketname/my-objectname can be uploaded by " + url); ``` ### presignedPutObject(String bucketName, String objectName, Integer expires) `public String presignedPutObject(String bucketName, String objectName, Integer expires)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#presignedPutObject-java.lang.String-java.lang.String-java.lang.Integer-)_ -Generates a presigned URL for HTTP PUT operations. Browsers/Mobile clients may point to this URL to upload objects directly to a bucket even if it is private. This presigned URL can have an associated expiration time in seconds after which it is no longer operational. The default expiry is set to 7 days. +Gets presigned URL of an object to upload data for expiry time. __Parameters__ | Parameter | Type | Description | |:---------------|:----------|:---------------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``expiry`` | _Integer_ | Expiry in seconds; defaults to 7 days. | +| ``expires`` | _Integer_ | Expiry in seconds; defaults to 7 days. | | Returns | |:------------------------------------------| @@ -1349,8 +1381,8 @@ __Parameters__ __Example__ ```java -String url = minioClient.presignedPutObject("my-bucketname", "my-objectname", 60 * 60 * 24); -System.out.println("my-bucketname/my-objectname can be uploaded by " + url); +// Get presigned URL to upload data to my-objectname with one day expiry. +String url = minioClient.presignedPutObject("my-bucketname", "my-objectname", 24 * 60 * 60); ``` @@ -1360,16 +1392,17 @@ System.out.println("my-bucketname/my-objectname can be uploaded by " + url); Uploads given stream as object in bucket by using given options. __Parameters__ -| Parameter | Type | Description | -|:---------------|:---------------------|:-------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``objectName`` | _String_ | Object name in the bucket. | -| ``stream`` | _InputStream_ | Stream contains object data. | -| ``options`` | _[PutObjectOptions]_ | Options to be used for upload. | +| Parameter | Type | Description | +|:---------------|:---------------------|:----------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectName`` | _String_ | Object name in the bucket. | +| ``stream`` | _InputStream_ | Stream contains object data. | +| ``options`` | _[PutObjectOptions]_ | Options to be used during upload. | __Example__ ```java -minioClient.putObject("my-bucketname", "my-objectname", stream, new PutObjectOptions(-1, 5 * MB)); +PutObjectOptions options = new PutObjectOptions(7003256, -1); +minioClient.putObject("my-bucketname", "my-objectname", stream, options); ``` @@ -1379,16 +1412,16 @@ minioClient.putObject("my-bucketname", "my-objectname", stream, new PutObjectOpt Uploads contents from a file as object in bucket using options. __Parameters__ -| Parameter | Type | Description | -|:---------------|:---------------------|:-------------------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``objectName`` | _String_ | Object name in the bucket. | -| ``fileName`` | _String_ | File name. | -| ``options`` | _[PutObjectOptions]_ | Options to be used for upload. | +| Parameter | Type | Description | +|:---------------|:---------------------|:---------------------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectName`` | _String_ | Object name in the bucket. | +| ``fileName`` | _String_ | Name of file to upload. | +| ``options`` | _[PutObjectOptions]_ | (Optional) Options to be used during upload. | __Example__ ```java -minioClient.putObject("my-bucketname", "my-objectname", "/mnt/photos/island,jpg", new PutObjectOptions(11 * MB, -1)); +minioClient.putObject("my-bucketname", "my-objectname", "my-filename", null); ``` @@ -1415,13 +1448,13 @@ minioClient.removeObject("my-bucketname", "my-objectname"); Removes multiple objects. __Parameters__ -| Parameter | Type | Description | -|:----------------|:-------------------|:--------------------| -| ``bucketName`` | _String_ | Name of the bucket. | -| ``objectNames`` | _Iterable _ | List of objects. | +| Parameter | Type | Description | +|:----------------|:-------------------|:-------------------------------| +| ``bucketName`` | _String_ | Name of the bucket. | +| ``objectNames`` | _Iterable _ | List of objects in the bucket. | -| Returns | -|:----------------------------------------------------------------------------------| +| Returns | +|:------------------------------------------------------------------------------------| | _Iterable<[Result]<[DeleteError]>>_: an iterator contains errors on object removal. | __Example__ @@ -1441,7 +1474,7 @@ for (Result result : results) { ### selectObjectContent(String bucketName, String objectName, String sqlExpression, InputSerialization is, OutputSerialization os, boolean requestProgress, Long scanStartRange, Long scanEndRange, ServerSideEncryption sse) `public SelectResponseStream selectObjectContent(String bucketName, String objectName, String sqlExpression, InputSerialization is, OutputSerialization os, boolean requestProgress, Long scanStartRange, Long scanEndRange, ServerSideEncryption sse)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#selectObjectContent-java.lang.String-java.lang.String-java.lang.String-io.minio.messages.InputSerialization-io.minio.messages.OutputSerialization-boolean-java.lang.Long-java.lang.Long-io.minio.ServerSideEncryption-)_ -Select object content using SQL expression. +Selects content of a object by SQL expression. __Parameters__ @@ -1450,12 +1483,12 @@ __Parameters__ | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | | ``sqlExpression`` | _String_ | SQL expression. | -| ``is`` | _[InputSerialization]_ | Object's input specification. | -| ``os`` | _[OutputSerialization]_ | Object's output specification. | +| ``is`` | _[InputSerialization]_ | Input specification of object data. | +| ``os`` | _[OutputSerialization]_ | Output specification of result. | | ``requestProgress`` | _boolean_ | Flag to request progress information. | | ``scanStartRange`` | _Long_ | scan start range of the object. | | ``scanEndRange`` | _Long_ | scan end range of the object. | -| ``sse`` | _[ServerSideEncryption]_ | Server-side encryptio.n | +| ``sse`` | _[ServerSideEncryption]_ | SSE-C type server-side encryption. | | Returns | |:------------------------------------------------------------------| @@ -1466,7 +1499,8 @@ __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); +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); @@ -1481,19 +1515,19 @@ stream.close(); ``` -### setObjectRetention(String bucketName, String objectName, String versionId, boolean bypassGovernanceRetention, Retention retention) -`public void setObjectLockRetention(String bucketName, String objectName, String versionId, boolean bypassGovernanceRetention, Retention retention)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setObjectRetention-java.lang.String-java.lang.String-java.lang.String-io.minio.messages.Retention-boolean-)_ +### setObjectRetention(String bucketName, String objectName, String versionId, Retention retention, boolean bypassGovernanceRetention) +`public void setObjectLockRetention(String bucketName, String objectName, String versionId, Retention retention, boolean bypassGovernanceRetention)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#setObjectRetention-java.lang.String-java.lang.String-java.lang.String-io.minio.messages.Retention-boolean-)_ -Applies object retention lock onto an object. +Sets retention configuration to an object. __Parameters__ | Parameter | Type | Description | |:------------------------------|:--------------|:--------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``versionId`` | _String_ | Object version. | -| ``bypassGovernanceRetention`` | _bool_ | By pass Governance Retention. | +| ``versionId`` | _String_ | Version ID of the object. | | ``config`` | _[Retention]_ | Object retention configuration. | +| ``bypassGovernanceRetention`` | _boolean_ | Bypass Governance retention. | __Example__ ```java @@ -1505,7 +1539,7 @@ minioClient.setObjectRetention("my-bucketname", "my-objectname", null, true, ret ### statObject(String bucketName, String objectName) `public ObjectStat statObject(String bucketName, String objectName)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#statObject-java.lang.String-java.lang.String-)_ -Gets metadata of an object. +Gets object information and metadata of an object. __Parameters__ | Parameter | Type | Description | @@ -1513,9 +1547,9 @@ __Parameters__ | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| Returns | -|:---------------------------------| -| _[ObjectStat]_: object metadata. | +| Returns | +|:-----------------------------------------------------------| +| _[ObjectStat]_: Populated object information and metadata. | __Example__ ```java @@ -1526,22 +1560,22 @@ ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname") ### statObject(String bucketName, String objectName, ServerSideEncryption sse) `public ObjectStat statObject(String bucketName, String objectName, ServerSideEncryption sse)` _[[Javadoc]](http://minio.github.io/minio-java/io/minio/MinioClient.html#statObject-java.lang.String-java.lang.String-io.minio.ServerSideEncryption-)_ -Returns meta data information of given object in given bucket. +Gets object information and metadata of a SSE-C encrypted object. __Parameters__ | Parameter | Type | Description | |:---------------|:-------------------------|:-----------------------------------| | ``bucketName`` | _String_ | Name of the bucket. | | ``objectName`` | _String_ | Object name in the bucket. | -| ``sse`` | _[ServerSideEncryption]_ | SSE-C type Server-side encryption. | +| ``sse`` | _[ServerSideEncryption]_ | SSE-C type server-side encryption. | -| Returns | -|:---------------------------------| -| _[ObjectStat]_: object metadata. | +| Returns | +|:-----------------------------------------------------------| +| _[ObjectStat]_: Populated object information and metadata. | __Example__ ```java -ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname", sse); +ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname", ssec); ``` ## 5. Explore Further @@ -1579,3 +1613,4 @@ ObjectStat objectStat = minioClient.statObject("my-bucketname", "my-objectname", [ObjectStat]: http://minio.github.io/minio-java/io/minio/ObjectStat.html [DeleteError]: http://minio.github.io/minio-java/io/minio/messages/DeleteError.html [SelectResponseStream]: http://minio.github.io/minio-java/io/minio/SelectResponseStream.html +[Method]: http://minio.github.io/minio-java/io/minio/http/Method.html