package com.crimson.addgroup;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import com.google.gdata.client.appsforyourdomain.AppsGroupsService;
import com.google.gdata.data.appsforyourdomain.AppsForYourDomainException;
import com.google.gdata.data.appsforyourdomain.generic.GenericEntry;
import com.google.gdata.util.ServiceException;
public class Addgroup {
public static void main(String[] args) throws IOException, AppsForYourDomainException, ServiceException {
AppsGroupsService groupService;
groupService = new AppsGroupsService(admin,password, domain, "Myapplication");
BufferedReader br= new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the group id ");
String groupid=br.readLine();
System.out.println("Enter the group name");
String gname=br.readLine();
System.out.println("Enter the group description ");
String gdesc=br.readLine();
System.out.println("Enter the Email permission");
String ownerUserName=br.readLine();
String GroupId =groupid;
String GroupName = gname;
String GroupDescription = gdesc;
String GroupPermission=ownerUserName;
GenericEntry groupsEntry;
groupsEntry =groupService.createGroup(GroupId, GroupName,GroupDescription,GroupPermission);
// groupsEntry = groupService.addOwnerToGroup(GroupId, ownerUserName);
System.out.println("Group created");
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment