code: private void listBuckets(WebContext ctx) {
          HttpMethod method = ctx.getRequest().method();
  
          if (GET == method) {
              List<Bucket> buckets = storage.getBuckets();
              Response response = ctx.respondWith();
  
              response.setHeader(HTTP_HEADER_NAME_CONTENT_TYPE, CONTENT_TYPE_XML);
  
              XMLStructuredOutput out = response.xml();
              out.beginOutput("ListAllMyBucketsResult",
                              Attribute.set("xmlns", "http://s3.amazonaws.com/doc/2006-03-01/"));
              out.property("hint", "Goto: " + ctx.getBaseURL() + "/ui to visit the admin UI");
              outputOwnerInfo(out, "Owner");
  
              out.beginObject("Buckets");
              for (Bucket bucket : buckets) {
                  out.beginObject(RESPONSE_BUCKET);
                  out.property("Name", bucket.getName());
                  out.property("CreationDate",
                               RFC822_INSTANT.format(Instant.ofEpochMilli(bucket.getFile().lastModified())));
                  out.endObject();
              }
              out.endObject();
              out.endOutput();
          } else {
              throw new IllegalArgumentException(ctx.getRequest().method().name());
          }
      }
docs: GET a list of all buckets
  
  @param ctx the context describing the current request