if it is MultipartFile then
use
public boolean isValidate(MultipartFile file) { return Objects.equals(file.getContentType(),"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); }