Class ExcelMediaFilenameExtensionValidator
java.lang.Object
com.hybris.backoffice.excel.validators.ExcelMediaImportValidator
com.hybris.backoffice.excel.validators.ExcelMediaFilenameExtensionValidator
- All Implemented Interfaces:
ExcelSingleMediaValidator,ExcelValidator
Validator which checks whether the uploaded file has a proper file extension. List of available file extensions is
configured via "excel.available.media.extensions".
-
Field Summary
FieldsFields inherited from class com.hybris.backoffice.excel.validators.ExcelMediaImportValidator
typeService, VALIDATION_DECLARED_MULTIPLE_REFERENCES, VALIDATION_MISSING_FILE_IN_ZIP, VALIDATION_MISSING_ZIP, VALIDATION_PATH_AND_CODE_EMPTYFields inherited from interface com.hybris.backoffice.excel.validators.ExcelValidator
CTX_MEDIA_CONTENT_ENTRIES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected Collection<String>protected StringgetValueToValidate(Map<String, String> parameters) protected booleanisNotAvailable(String extension) voidsetConfigurationService(ConfigurationService configurationService) Allows to validate single media.protected List<ValidationMessage>validateZipEntries(String filePath) Methods inherited from class com.hybris.backoffice.excel.validators.ExcelMediaImportValidator
canHandle, getImportService, getTypeService, hasImportData, setImportService, setTypeService, validate
-
Field Details
-
EXCEL_IMPORT_VALIDATION_MEDIA_EXTENSIONS
- See Also:
-
CONFIG_EXCEL_AVAILABLE_MEDIA_EXTENSIONS
- See Also:
-
-
Constructor Details
-
ExcelMediaFilenameExtensionValidator
public ExcelMediaFilenameExtensionValidator()
-
-
Method Details
-
validateSingleValue
public List<ValidationMessage> validateSingleValue(Map<String, Object> context, Map<String, String> parameters) Description copied from interface:ExcelSingleMediaValidatorAllows to validate single media.- Specified by:
validateSingleValuein interfaceExcelSingleMediaValidator- Overrides:
validateSingleValuein classExcelMediaImportValidator- Parameters:
context- which allows to hold information about the file.parameters- values of excel's cell.- Returns:
- the collection of errors. If media has no errors, then the empty collection should be returned.
-
getValueToValidate
-
validateZipEntries
-
isNotAvailable
-
getConfigExtensions
-
getAvailableExtensions
-
setConfigurationService
-