2011-08-30 52 views
1

我想通過它的名字得到一個集合/文件夾,但我得到一個錯誤,這是我的了:獲取集合/文件夾

DocsService client = new DocsService("test testnet v1"); 
    //Get the ur to access google docs folders 
    URL feedUrl=new URL("https://docs.google.com/feeds/default/private/full/folder%3Aroot?oauth_token="+token); 

    DocumentQuery query = new DocumentQuery(feedUrl); 
    query.setTitleQuery(name); 
    query.setTitleExact(true); 
    DocumentListFeed feed=null; 

    try { 
     feed = client.getFeed(query, DocumentListFeed.class); 
    } catch (IOException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } catch (ServiceException e) { 
     // TODO Auto-generated catch block 
     e.printStackTrace(); 
    } 
    //Get the entry founded 

    for (DocumentListEntry entry : feed.getEntries()) { 
      resourceId = entry.getDocId(); 
    } 

希望有一個可以幫助我,Thx。

回答

3

使用網址https://docs.google.com/feeds/default/private/full/-/folder將列出文件夾(或者您可以按名稱執行搜索查詢)。從該列表中,您可以按名稱找到您的文件夾,然後通過使用 https://docs.google.com/feeds/default/private/full/[resource id]/contents

通過資源ID執行查詢I不要以爲有更簡單的方法。