}
private Account.Id createAccountByLdap(String user)
throws CmdLineException {
if (!user.matches(Account.USER_NAME_PATTERN)) {
throw new CmdLineException(owner, "user \"" + user + "\" not found");
}
try {
AuthRequest req = AuthRequest.forUser(user);
req.setSkipAuthentication(true);
return accountManager.authenticate(req).getAccountId();
} catch (AccountException e) {
throw new CmdLineException(owner, "user \"" + user + "\" not found");
}
}