我使用以下代码来显示我的域中的用户帐户,但是在该代码中它仅显示前100条记录,但是在我的域中却显示了近500个用户帐户。

import java.net.URL;
import java.util.List;

import com.google.gdata.client.appsforyourdomain.UserService;
import com.google.gdata.data.appsforyourdomain.provisioning.UserEntry;
import com.google.gdata.data.appsforyourdomain.provisioning.UserFeed;

public class Readuser {
       public int i3;
       public  String rn[]=new String[100];



    public void read(){
        try
        {

                // Create a new Apps Provisioning service
                UserService myService = new UserService("My Application");
                myService.setUserCredentials(admin,password);

                // Get a list of all entries
                URL metafeedUrl = new URL("https://www.google.com/a/feeds/"+domain+"/user/2.0/");
                System.out.println("Getting user entries...\n");
                UserFeed resultFeed = myService.getFeed(metafeedUrl, UserFeed.class);
                List<UserEntry> entries = resultFeed.getEntries();

                for(i3=0; i3<entries.size(); i3++) {
                  UserEntry entry = entries.get(i3);
                  rn[i3]=  entry.getTitle().getPlainText();
                  System.out.println(rn[i3]);
                }
                System.out.println("\nTotal Entries: "+entries.size());
              }
             catch(Exception e) { System.out.print(e);}
         }

    public static void main(String args[])
    {
    Readuser ru=new Readuser();
    ru.read();
    }
}

最佳答案

您只分配100个条目。

public  String rn[]=new String[100];

10-07 19:37