Class FileWipingContentCleanerListener
java.lang.Object
org.alfresco.repo.content.cleanup.FileWipingContentCleanerListener
- All Implemented Interfaces:
ContentStoreCleanerListener
Simple listener that overwrites files with zeros.
Wire this into the
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.
- Since:
- 4.0.1
- Author:
- Derek Hulley
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeDelete(ContentStore sourceStore, String contentUrl) Handle the notification that a store is about to be deletedprotected voidCalled byshred(ContentReader)when the reader points to a physical file.protected voidshred(ContentReader reader) Override to perform shredding on disparate forms of readers.
-
Constructor Details
-
FileWipingContentCleanerListener
public FileWipingContentCleanerListener()
-
-
Method Details
-
beforeDelete
Description 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:
ContentIOException
-
shred
Override 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:
IOException- any IO error
-
shred
Called 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:
IOException- any IO error
-