Deleting a file on an ongoing basis is equivalent to sending a DELETE request to the file editing URL with the request parameter "delete = true" (skip garbage):
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 ETAG>");
If you want to bypass the etag check, you can pass a special value "*".
Alain source
share