I am trying to add contacts using batch processing in Java.  I have
isolated a problem which causes my current contacts to be reinserted
thereby duplicating them in my contacts list.  I was able to isolate
this problem with this simple piece of code...

try
{
  ContactFeed contactFeed = contactsService.getFeed(getContactsFeedURL
(), ContactFeed.class);
  Link batchLink = contactFeed.getLink(Link.Rel.FEED_BATCH,
Link.Type.ATOM);

  if (batchLink != null)
  {
    URL batchURL = new URL(batchLink.getHref());
// normally I would do a contactFeed.insert(<ContactEntry>) here to
add a new contact
    contactsService.batch(batchURL, contactFeed);
  }
}
catch (Exception e)
{
  e.printStackTrace();
}

I assume my problem is using the existing ContactFeed object for the
batch call but when I try to use a "new" one I get an error message
saying that the feed is not related to a service.  Can someone point
me in the right direction?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to