code: public Iterable<Result<Item>> listObjects(final String bucketName, final String prefix, final boolean recursive,
                                              final boolean useVersion1) {
      if (useVersion1) {
        return listObjectsV1(bucketName, prefix, recursive);
      }
  
      return listObjectsV2(bucketName, prefix, recursive);
    }
docs: Lists object information as {@code Iterable<Result><Item>} in given bucket, prefix, recursive flag and S3 API
  version to use.
  
  </p><b>Example:</b><br>
  <pre>{@code Iterable<Result<Item>> myObjects = minioClient.listObjects("my-bucketname", "my-object-prefix", true,
  false);
  for (Result<Item> result : myObjects) {
  Item item = result.get();
  System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName());
  } }</pre>
  
  @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.
  
  @return an iterator of Result Items.
  
  @see #listObjects(String bucketName)
  @see #listObjects(String bucketName, String prefix)
  @see #listObjects(String bucketName, String prefix, boolean recursive)