Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7867001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:35:22+00:00 2026-06-03T00:35:22+00:00

I can insert a Google Document in a folder/collection using the Java API. But

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:35:24+00:00Added an answer on June 3, 2026 at 12:35 am

    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.

      public DocumentListEntry moveObjectToFolder(String resourceId, String folderId)
          throws IOException, MalformedURLException, ServiceException, DocumentListException {
        if (resourceId == null || folderId == null) {
          throw new DocumentListException("null passed in for required parameters");
        }
    
        DocumentListEntry doc = new DocumentListEntry();
        doc.setId(buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + "/" + resourceId).toString());
    
        URL url = buildUrl(URL_DEFAULT + URL_DOCLIST_FEED + "/" + folderId + URL_FOLDERS);
        return service.insert(url, doc);
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that I can insert multiple rows using a single statement, if I
I am using Google Data API for .Net(version 1.9) in my application. I have
I have made a very simple page using google maps API with several fields
I can insert annotations on specific datasets on the graph but I wish to
I know that you can insert multiple rows at once, is there a way
EntityManager.merge() can insert new objects and update existing ones. Why would one want to
I have a JSP page, so the user can insert the time when he/she
I have started this support ticket project where users can create tickets and the
Using JavaScript, how can i open a new window (loading, say, http://www.google.com in the
Can I insert another image as a pin in Google Maps? The project is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.