validateNotEmpty method

String? validateNotEmpty()

Validates if the file is not empty.

Implementation

String? validateNotEmpty() {
  if (!existsSync()) {
    return "File does not exist.";
  }
  if (lengthSync() == 0) {
    return "File is empty.";
  }
  return null;
}