in src/main/java/com/epam/digital/data/platform/registry/regulation/validation/cli/validator/file/EmptyFileValidator.java [33:47]
public Set<ValidationError> validate(File regulationFile, ValidationContext validationContext) {
try {
var content = readFileContent(regulationFile);
if (StringUtils.isBlank(content)) {
return Collections.singleton(
ValidationError.of(validationContext.getRegulationFileType(), regulationFile, "File must not be empty")
);
}
return Collections.emptySet();
} catch (IOException ex) {
return Collections.singleton(
ValidationError.of(validationContext.getRegulationFileType(), regulationFile, "File processing failure", ex)
);
}
}