code: public static List<String> findIndexNames(final String root) throws IOException, URISyntaxException {
          if (root == null) {
              return findIndexNames();
          }
  
          logger.debug("Looking for indices in classpath under [{}].", root);
  
          final List<String> indexNames = new ArrayList<>();
          final Set<String> keys = new HashSet<>();
          String[] resources = ResourceList.getResources(root + "/"); // "es/" or "a/b/c/"
          for (String resource : resources) {
              if (!resource.isEmpty()) {
                  logger.trace(" - resource [{}].", resource);
                  String key;
                  if (resource.contains("/")) {
                      key = resource.substring(0, resource.indexOf("/"));
                  } else {
                      key = resource;
                  }
                  if (!key.equals(Defaults.TemplateDir) && !keys.contains(key)) {
                      logger.trace(" - found [{}].", key);
                      keys.add(key);
                      indexNames.add(key);
                  }
              }
          }
  
          return indexNames;
      }
docs: Find all indices existing in a given classpath dir
  @param root dir within the classpath
  @return a list of indices
  @throws IOException if connection with elasticsearch is failing
  @throws URISyntaxException this should not happen