Package ch.tocco.nice2.dms.impl.validate
Class ResourceContentFileTypeValidator
java.lang.Object
ch.tocco.nice2.persist.core.api.validation.AbstractEntitiesValidator
ch.tocco.nice2.dms.impl.validate.ResourceContentFileTypeValidator
- All Implemented Interfaces:
EntitiesValidator
@ConditionalOnProperty(value="nice2.dms.validateFileTypes",
havingValue="true",
matchIfMissing=true)
public class ResourceContentFileTypeValidator
extends AbstractEntitiesValidator
checks files uploaded to dms that they match allowed file types as contributed through
DmsAllowedFileTypeContribution
if no allowed file types are contributed, any file is accepted-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setAllowedFileTypes
(DmsAllowedFileTypeContribution dmsAllowedFileTypeContribution, List<AllowedFileTypeContribution> allowedFileTypeContributions) void
Validate all entities (of one entity model) that where changed in a transactionMethods inherited from class ch.tocco.nice2.persist.core.api.validation.AbstractEntitiesValidator
addMyself, getName
-
Field Details
-
MESSAGE_KEY
- See Also:
-
-
Constructor Details
-
ResourceContentFileTypeValidator
public ResourceContentFileTypeValidator()
-
-
Method Details
-
validate
public void validate(List<Entity> resourceContents, Map<Entity, EntityValidationResult> validationResults) Description copied from interface:EntitiesValidator
Validate all entities (of one entity model) that where changed in a transaction- Parameters:
resourceContents
- the entities to be validatedvalidationResults
- a map of EntityValidationResults, contains anEntityValidationResult
for each entity. SeeEntityValidationResult
for more details on how to use the EntityValidationResult
-
setAllowedFileTypes
@Autowired(required=false) public void setAllowedFileTypes(DmsAllowedFileTypeContribution dmsAllowedFileTypeContribution, List<AllowedFileTypeContribution> allowedFileTypeContributions)
-