cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting Nuxeo Document Permanently Programatically

SMAH_Haider
Star Contributor
Star Contributor

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.

Thanks.

3 REPLIES 3

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

If you mean you'd like to clear the blobs, maybe documentation at http://doc.nuxeo.com/x/lAQz gives helpful information.

Hello,

SMAH_Haider
Star Contributor
Star Contributor

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

RepositoryStatus myRepositoryStatus = new RepositoryStatus(); myRepositoryStatus.gcBinaries(true);

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

Thanks.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.