3

我正在尝试使用 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();
4

1 回答 1

3

永久删除文件等同于使用查询参数“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”检查,你可以通过特殊值"*"

于 2012-04-12T18:59:40.810 回答