I can insert a Google Document in a folder/collection using the Java API. But I would like to have this document in multiple folders. The method
public void addFolder(Person owner, java.lang.String folderName)
is deprecated. In the javadoc it refers to: BaseEntry.addLink(Link).
I tried using that method as follows:
docEntry.addLink(DocumentListLink.Rel.PARENT, Link.Type.ATOM,
folderEntry.getSelfLink().getHref());
This method does not work, I probably use the wrong parameters.
So how can I link a document to multiple folders/collections?
Found it here: http://gdata-java-client.googlecode.com/svn/trunk/java/sample/docs/DocumentList.java
Inserting the document twice to different collections works using the code in the method below. I am still curious though why the addlink method fails for me.