I am trying to delete a Google document by using Java APIm it works fine but the document is getting settled in the trash folder. I want the document to get deleted permanently even from trash. Can someone please suggest me a solution on how to work on this?This is the code that I've been using to delete the document.
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();
Deleting a file permanently is equivalent to sending a DELETE request to the file's edit URL with the query parameter "delete=true" (skip trash):
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>");
If you want to by-pass the "etag" check, you can pass the special value "*".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With