diff --git a/api/src/main/java/io/minio/MinioClient.java b/api/src/main/java/io/minio/MinioClient.java index ac969aee8..73ac0287e 100755 --- a/api/src/main/java/io/minio/MinioClient.java +++ b/api/src/main/java/io/minio/MinioClient.java @@ -2985,7 +2985,8 @@ private List removeObject(String bucketName, List obj /** - * Removes multiple objects from a bucket. + * Removes multiple objects from a bucket. As objects removal are lazily executed, its required + * to iterate the returned Iterable. * *

Example:
*
{@code // Create object list for removal.
@@ -3000,6 +3001,8 @@ private List removeObject(String bucketName, List obj
    *
    * @param bucketName Bucket name.
    * @param objectNames List of Object names in the bucket.
+   *
+   * @return (lazy) Iterable of the Result DeleteErrors.
    */
   public Iterable> removeObjects(final String bucketName, final Iterable objectNames) {
     return new Iterable>() {
diff --git a/examples/RemoveObjects.java b/examples/RemoveObjects.java
index b2b3de0a2..7802f0555 100644
--- a/examples/RemoveObjects.java
+++ b/examples/RemoveObjects.java
@@ -48,6 +48,7 @@ public static void main(String[] args)
       objectNames.add("my-objectname3");
 
       // Remove object all objects 'objectNames' list from 'my-bucketname'.
+      // It is required to traverse over the returned Iterable for lazy evaluation.
       for (Result errorResult: minioClient.removeObjects("my-bucketname", objectNames)) {
         DeleteError error = errorResult.get();
         System.out.println("Failed to remove '" + error.objectName() + "'. Error:" + error.message());