public class FileWipingContentCleanerListener extends java.lang.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(ContentStore sourceStore,
java.lang.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(java.io.File file)
Called by
FileWipingContentCleanerListener.shred(ContentReader) when the reader points to a physical file. |
public void beforeDelete(ContentStore sourceStore, java.lang.String contentUrl) throws org.alfresco.service.cmr.repository.ContentIOException
ContentStoreCleanerListenerbeforeDelete in interface ContentStoreCleanerListenersourceStore - the store from which the content will be deletedcontentUrl - the URL of the content to be deletedorg.alfresco.service.cmr.repository.ContentIOExceptionprotected void shred(org.alfresco.service.cmr.repository.ContentReader reader)
throws java.io.IOException
reader - the reader to the content needing shreddingjava.io.IOException - any IO errorprotected void shred(java.io.File file)
throws java.io.IOException
FileWipingContentCleanerListener.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 deletionjava.io.IOException - any IO errorCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.