Currently as part of a tool that has been designed to add users to a role we have been using the following code to add them. However, if it encounters a user that does not exist in the docbase it will stop running there, is there any way to check if the users exist before trying to add them and to then skip over the user that does not exist?
private static void loadUsers(String userfile,IDfGroup group){
System.out.println("Connecting.. and loading file," + userfile);
String userName = null;
try {
FileReader fileReader = new FileReader(userfile);
BufferedReader bufferedReader = new BufferedReader(fileReader);
while((userName = bufferedReader.readLine()) != null) {
System.out.println(userName);
group.addUser(userName);
group.save();
}
bufferedReader.close();
}