Class FileWipingContentCleanerListener

  • All Implemented Interfaces:
    ContentStoreCleanerListener

    public class FileWipingContentCleanerListener
    extends Object
    implements 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 Detail

      • FileWipingContentCleanerListener

        public FileWipingContentCleanerListener()
    • Method Detail

      • shred

        protected void shred​(ContentReader reader)
                      throws IOException
        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

        protected void shred​(File file)
                      throws IOException
        Called by shred(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