it works with enum but i cant create an enum with spaces, then i created filename. Is it possible to check file name?
public enum ModulacaoFilesEnum {
FILE001("FILE 001.xlsx"),
FILE002("FILE 002.xlsx"),
FILE003("FILE 003.xlsx");
@Getter
private final String fileName;
ModulacaoFilesEnum(String fileName) {
this.fileName = fileName;
}
}
from
if (EnumUtils.isValidEnum(ModulacaoFilesEnum.class, file.getOriginalFilename())) {
throw new NotModulacaoFileException(file);
}