Deleting Nuxeo Document Permanently Programatically

I am currently deleting a document from Nuxeo repository using the following code:

String myDocumentPath = // path to a folder
DocumentRef myFolderRef = new PathRef(documentPath);

if(aSession.exists(myFolderRef) && aSession.canRemoveDocument(myFolderRef )) {
aSession.removeChildren(myFolderRef); }

All the files under the folder gets deleted successfully but not permanently. I was wondering if there is anyway I could delete documents permanently programatically including binaries on file system?

I dont want to wait for the Garbage collector to delete those binaries from file system after the retentions period.


0 votes

2 answers



Success! I have been able to do it this way.

RepositoryStatus myRepositoryStatus = new RepositoryStatus();

The method gcBinaries delete the binaries if flag passed to it is true. Otherwise it only returns the statistics about the binaries.


0 votes


If you mean you'd like to clear the blobs, maybe documentation at gives helpful information.

0 votes


Thanks Anahide for your reply. I forgot to mention that I am using Tomcat bundled Nuxeo 5.6 which does not have this script mentioned in the documentation.

And I want to delete binaries from file system pragmatically.