// Perform introspection. This is an optional step. If you already
// know the URI of the APP collection to POST to, you can skip it.
Document<Service> introspection = abderaClient.get(args[0]).getDocument();
Service service = introspection.getRoot();
Collection collection = service.getCollection(args[1], args[2]);
report("The Collection Element", collection.toString());
// Create the entry to post to the collection
Entry entry = factory.newEntry();
entry.setId("tag:example.org,2006:foo");
entry.setTitle("This is the title");
entry.setUpdated(new Date());
entry.addAuthor("James");
entry.setContent("This is the content");
report("The Entry to Post", entry.toString());
// Post the entry. Be sure to grab the resolved HREF of the collection
Document<Entry> doc = abderaClient.post(collection.getResolvedHref().toString(), entry).getDocument();
// In some implementations (such as Google's GData API, the entry URI is
// distinct from it's edit URI. To be safe, we should assume it may be
// different
IRI entryUri = doc.getBaseUri();