public static Set<String> getExternalProfileNames() {
    final Path profilesDir = defaultProfilesDir();
    if (!Files.exists(profilesDir)) {
      return Set.of();
    }

    try (Stream<Path> pathStream = Files.list(profilesDir)) {
      return pathStream
          .filter(Files::isRegularFile)
          .filter(path -> path.toString().endsWith(".toml"))
          .map(
              path ->
                  path.getFileName()
                      .toString()
                      .substring(0, path.getFileName().toString().length() - 5))
          .collect(Collectors.toSet());
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
Returns the external profile names which are file names without extension in the default
profiles directory.

@return Set of external profile names
app/src/main/java/org/hyperledger/besu/cli/util/ProfileFinder.java