public class FileWipingContentCleanerListener extends Object implements ContentStoreCleanerListener
EagerContentStoreCleaner
as a listener and it will
ensure that files have their contents overwritten with zeros before deletion.
Note that this process does not affect the content lifecycyle in any way
i.e. content will still follow the same orphan path as before.
Clearly wiring this up with a DeletedContentBackupCleanerListener
is
pointless as you will be making a copy of the before wiping it or end up
copying a file full of zero depending on the order of the listeners.
Constructor and Description |
---|
FileWipingContentCleanerListener() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDelete(org.alfresco.repo.content.ContentStore sourceStore,
String contentUrl)
Handle the notification that a store is about to be deleted
|
protected void |
shred(org.alfresco.service.cmr.repository.ContentReader reader)
Override to perform shredding on disparate forms of readers.
|
protected void |
shred(File file)
Called by
shred(ContentReader) when the reader points to a physical file. |
public void beforeDelete(org.alfresco.repo.content.ContentStore sourceStore, String contentUrl) throws org.alfresco.service.cmr.repository.ContentIOException
ContentStoreCleanerListener
beforeDelete
in interface ContentStoreCleanerListener
sourceStore
- the store from which the content will be deletedcontentUrl
- the URL of the content to be deletedorg.alfresco.service.cmr.repository.ContentIOException
protected void shred(org.alfresco.service.cmr.repository.ContentReader reader) throws IOException
reader
- the reader to the content needing shreddingIOException
- any IO errorprotected void shred(File file) throws IOException
shred(ContentReader)
when the reader points to a physical file.
The default implementation simply overwrites the content with zeros.file
- the file to shred before deletionIOException
- any IO errorCopyright © 2005–2017 Alfresco Software. All rights reserved.