for loop is not applicable

This commit is contained in:
Ben Bosman
2020-10-01 16:17:26 +02:00
parent 88e073d8f2
commit 8f824c0642

View File

@@ -41,15 +41,11 @@ public class UploadValidation extends AbstractValidation {
SubmissionStepConfig config) throws DCInputsReaderException, SQLException { SubmissionStepConfig config) throws DCInputsReaderException, SQLException {
//TODO MANAGE METADATA //TODO MANAGE METADATA
for (String key : uploadConfigurationService.getMap().keySet()) { UploadConfiguration uploadConfig = uploadConfigurationService.getMap().get(config.getId());
if (getName().equals(key)) { if (uploadConfig.isRequired() && !itemService.hasUploadedFiles(obj.getItem())) {
UploadConfiguration uploadConfig = uploadConfigurationService.getMap().get(config.getId()); addError(ERROR_VALIDATION_FILEREQUIRED,
if (uploadConfig.isRequired() && !itemService.hasUploadedFiles(obj.getItem())) { "/" + WorkspaceItemRestRepository.OPERATION_PATH_SECTIONS + "/"
addError(ERROR_VALIDATION_FILEREQUIRED, + config.getId());
"/" + WorkspaceItemRestRepository.OPERATION_PATH_SECTIONS + "/"
+ config.getId());
}
}
} }
return getErrors(); return getErrors();
} }