Class FileWipingContentCleanerListener
- java.lang.Object
-
- org.alfresco.repo.content.cleanup.FileWipingContentCleanerListener
-
- All Implemented Interfaces:
ContentStoreCleanerListener
public class FileWipingContentCleanerListener extends java.lang.Object implements ContentStoreCleanerListener
Simple listener that overwrites files with zeros. Wire this into theEagerContentStoreCleaneras 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
DeletedContentBackupCleanerListeneris 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.- Since:
- 4.0.1
- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description FileWipingContentCleanerListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDelete(org.alfresco.repo.content.ContentStore sourceStore, java.lang.String contentUrl)Handle the notification that a store is about to be deletedprotected voidshred(java.io.File file)Called byshred(ContentReader)when the reader points to a physical file.protected voidshred(org.alfresco.service.cmr.repository.ContentReader reader)Override to perform shredding on disparate forms of readers.
-
-
-
Method Detail
-
beforeDelete
public void beforeDelete(org.alfresco.repo.content.ContentStore sourceStore, java.lang.String contentUrl) throws org.alfresco.service.cmr.repository.ContentIOExceptionDescription copied from interface:ContentStoreCleanerListenerHandle the notification that a store is about to be deleted- Specified by:
beforeDeletein interfaceContentStoreCleanerListener- Parameters:
sourceStore- the store from which the content will be deletedcontentUrl- the URL of the content to be deleted- Throws:
org.alfresco.service.cmr.repository.ContentIOException
-
shred
protected void shred(org.alfresco.service.cmr.repository.ContentReader reader) throws java.io.IOExceptionOverride to perform shredding on disparate forms of readers. This implementation will, by default, identify more specific readers and make calls for those.- Parameters:
reader- the reader to the content needing shredding- Throws:
java.io.IOException- any IO error
-
shred
protected void shred(java.io.File file) throws java.io.IOExceptionCalled byshred(ContentReader)when the reader points to a physical file. The default implementation simply overwrites the content with zeros.- Parameters:
file- the file to shred before deletion- Throws:
java.io.IOException- any IO error
-
-