class WalChecker {

  public List<File> doCheck() throws SystemCheckException {
    File walFolderFile = SystemFileFactory.INSTANCE.getFile(walFolder);
    logger.info("Checking folder: {}", walFolderFile.getAbsolutePath());
    if(!walFolderFile.exists() || !walFolderFile.isDirectory()) {
      throw new SystemCheckException(walFolder);
    }

    File[] storageWalFolders = walFolderFile.listFiles();
    if (storageWalFolders == null || storageWalFolders.length == 0) {
      logger.info("No sub-directories under the given directory, check ends");
      return Collections.emptyList();
    }

    List<File> failedFiles = new ArrayList<>();
    for (int dirIndex = 0; dirIndex < storageWalFolders.length; dirIndex++) {
      File storageWalFolder = storageWalFolders[dirIndex];
      logger.info("Checking the No.{} directory {}", dirIndex, storageWalFolder.getName());
      File walFile = SystemFileFactory.INSTANCE.getFile(storageWalFolder, WAL_FILE_NAME);
      if (!checkFile(walFile)) {
        failedFiles.add(walFile);
      }
    }
    return failedFiles;
  }

  public  WalChecker(String walFolder);

}