public static void main(String[] args)
    throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
    try {
      /* play.min.io for test and development. */
      MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F",
                                                "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");

      /* Amazon S3: */
      // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
      //                                           "YOUR-SECRETACCESSKEY");

      // Check whether 'my-bucketname' exist or not.
      boolean found = minioClient.bucketExists("my-bucketname");
      if (found) {
        // List objects from 'my-bucketname'
        Iterable<Result<Item>> myObjects = minioClient.listObjects("my-bucketname");
        for (Result<Item> result : myObjects) {
          Item item = result.get();
          System.out.println(item.lastModified() + ", " + item.size() + ", " + item.objectName());
        }
      } else {
        System.out.println("my-bucketname does not exist");
      }
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
    }
  }
public static void main ( String [ ] args ) throws IOException , NoSuchAlgorithmException , InvalidKeyException , XmlPullParserException { try { MinioClient minioClient = new MinioClient ( "https://play.min.io:9000" , "Q3AM3UQ867SPQQA43P2F" , "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG" ) ; boolean found = minioClient . bucketExists ( "my-bucketname" ) ; if ( found ) { Iterable < Result < Item > > myObjects = minioClient . listObjects ( "my-bucketname" ) ; for ( Result < Item > result : myObjects ) { Item item = result . get ( ) ; System . out . println ( item . lastModified ( ) + ", " + item . size ( ) + ", " + item . objectName ( ) ) ; } } else { System . out . println ( "my-bucketname does not exist" ) ; } } catch ( MinioException e ) { System . out . println ( "Error occurred: " + e ) ; } }
MinioClient.listObjects() example.