List<String> lineElementList = Arrays.asList(lineElements);
Properties properties = buildProperties(headerElementList, lineElementList);
String userName = lineElementList.get(userNamePos);
String password = lineElementList.get(passwordPos);
if (userService.isUsernameSyntaxCorrect(userName)) {
PolicyEnforcementResult evalResult = pwdPolicyService.enforcePolicyOnUserCreate(userName, password);
if (evalResult.isSuccess()) {
JahiaUser jahiaUser = userManager.createUser(userName, password, properties);
if (jahiaUser != null) {
usersCreatedSuccessfully++;
logger.info("Successfully created user {}", userName);
} else {
errorsCreatingUsers++;
logger.warn("Error creating user {}", userName);
}
} else {
errorsCreatingUsers++;
StringBuilder result = new StringBuilder();
for (String msg : evalResult.getTextMessages()) {
result.append(msg).append("\n");
}
logger.warn("Skipping user {}. Following password policy rules are violated\n{}", userName, result.toString());
}
} else {