【问题标题】:Delete a Google document permanently永久删除 Google 文档
【发布时间】:2012-04-12 17:13:27
【问题描述】:

我正在尝试使用 Java APIm 删除 Google 文档,它可以正常工作,但该文档正在垃圾文件夹中。我希望文档即使从垃圾箱中也能永久删除。有人可以建议我如何解决这个问题吗?这是我一直用来删除文档的代码。

    DocsService docsService = new DocsService(domain);
    URL docURL = new URL("https://docs.google.com/feeds/default/private/full/"+resourceId+"?xoauth_requestor_id=" + loginUser);//No I18N
    DocumentListEntry sd=docsService.getEntry(docURL, DocumentListEntry.class);
    sd.delete();

【问题讨论】:

    标签: google-docs google-docs-api


    【解决方案1】:

    永久删除文件相当于使用查询参数“delete=true”(跳过垃圾箱)向文件的编辑 URL 发送 DELETE 请求:

    DocsService docsService = new DocsService(domain);
    URL docURL = new URL(
        "https://docs.google.com/feeds/default/private/full/"+resourceId+"?xoauth_requestor_id=" + loginUser + "&delete=true");
    docsService.delete(docURL, "<ENTRY'S ETAG>");
    

    如果你想绕过“etag”检查,你可以通过特殊值"*"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多