private File[] findChildrenExcept(final File dir, final Pattern pattern, final File exception) {
    final String exceptionName = (exception == null) ? null : exception.getName();
    if (dir == null) {
      return new File[] {};
    }
    return dir
        .listFiles((dir1, name) -> !name.equals(exceptionName) && pattern.matcher(name).matches());
  }
Extracted from ManagerLogWriter. MainWithChildrenRollingFileHandler is used for both rolling of
log files and stat archive files.
geode-core/src/main/java/org/apache/geode/internal/io/MainWithChildrenRollingFileHandler.java