httpclient得到gmai,yahoo列表

来源:互联网 发布:本子作者知乎 编辑:程序博客网 时间:2024/05/02 00:30

Importing contacts from these services very easy with the ContactListImporter library. The following code imports all contacts and prints them to System.out:

import com.xdatasystem.contactsimporter.*;

// automatically guess the correct implementaion based on the email address
ContactListImporter importer=ContactListImporterFactory.guess("someuser@hotmail.com","password");
List<Contact> contacts=importer.getContactList();
for(Contact c : contacts){
 
System.out.println("name: "+c.getName()+", email: "+c.getEmail());
}

Other ways to instantiate a ContactListImporter using the factory can be done as follows:

// creates an hotmail contact importer
importer
=ContactListImporterFactory.hotmail("someuser@hotmail.com","password");
// creates an gmail contact importer
importer
=ContactListImporterFactory.gmail("someuser@gmail.com","password");
具体地址:http://code.google.com/p/contactlistimporter/
原创粉丝点击