All pastes #2087155 Raw Edit

Unnamed

public text v1 · immutable
#2087155 ·published 2011-10-05 16:58 UTC
rendered paste body
@Override
	public boolean createContactGroup(String newGroupName) {
			MetaContactListService service = getMetaContactListService();
			MetaContactGroup root = service.getRoot();
			
			Iterator<MetaContactGroup> iterator = root.getSubgroups();
			
			logger.info("Trying to create group: " + newGroupName);
			while(iterator.hasNext())
			{
				MetaContactGroup group = iterator.next();
				
				logger.info("group : " + group.getGroupName());
				//don't duplicate groups
				if (newGroupName.equalsIgnoreCase(group.getGroupName()));
				{
					logger.info("groupName: " + newGroupName + " is equal to " + group.getGroupName() );
				}
			}
			
			//this group doesn't exist, so create it
			service.createMetaContactGroup(root, newGroupName);
			logger.info("Created group : " + newGroupName);
			return true;
	}