java program to get all cat indices in elasticsearch javadoc

Java
GetIndexRequest request = new GetIndexRequest().indices("*");
GetIndexResponse response = client.indices().get(request, RequestOptions.DEFAULT);
String[] indices = response.getIndices();
Source

Also in Java: