The example is based on the code in the ContentUpdate.java sample file.

This example uses the steps that are described in Listing All Content Libraries.

Note: For a complete and up-to-date version of the sample code, see the vSphere Automation SDK Java samples at GitHub.
...
 
// Access the Library Service.
   Library libraryService = vapiAuthHelper.getStubFactory().createStub(Library.class, sessionStubConfig);

// List all content libraries.
   List<String> allLibraries = libraryService.list();
   System.out.println("List of all library identifiers: /n");
   for (String cl : allLibraries) {
         System.out.println(cl);
   }