All pastes #356840 Raw Edit

Stuff

public java v1 · immutable
·published 2007-02-15 09:05 UTC
rendered paste body
public void addRosterToUsers() {                String tmpUser = "";                JID innerTmpUser;                Collection<String> c = conn.getUsernames();                for (Object o : c) {                        tmpUser = (String)o;                        if (tmpUser.equals("admin"))                                continue;                        System.out.println("--> Processing roster for user "+ tmpUser);                        Roster r = new Roster(tmpUser);                        for (Object inner_o : c) {                                innerTmpUser = new JID((String)inner_o,"@wonderlight", "Spark");                                System.out.println(tmpUser + ": Adding user " + innerTmpUser.toString());                                try {                                        r.createRosterItem(innerTmpUser, true, true);                                } catch (UserAlreadyExistsException uae) {                                        System.out.println("Unable to add "+ innerTmpUser.toString() +" to roster. User already exists.");                                } catch (SharedGroupException sge) {                                        System.out.println("Unable to add "+ innerTmpUser.toString() +" to roster. Shared user group exception.");                                }                        }                }        }