Class MediaFilter

java.lang.Object
org.dspace.app.mediafilter.MediaFilter
All Implemented Interfaces:
FormatFilter
Direct Known Subclasses:
BrandedPreviewJPEGFilter, ImageMagickThumbnailFilter, JPEGFilter, PDFBoxThumbnail, TikaTextExtractionFilter

public abstract class MediaFilter extends Object implements FormatFilter
Abstract class which defines the default settings for a *simple* Media or Format Filter. This class may be extended by any class which wishes to define a simple filter to be run by the MediaFilterManager. More complex filters should likely implement the FormatFilter interface directly, so that they can define their own pre/postProcessing methods.
  • Constructor Details

    • MediaFilter

      public MediaFilter()
  • Method Details

    • preProcessBitstream

      public boolean preProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) throws Exception
      Perform any pre-processing of the source bitstream *before* the actual filtering takes place in MediaFilterManager.processBitstream().

      Return true if pre-processing is successful (or no pre-processing is necessary). Return false if bitstream should be skipped for any reason.

      Specified by:
      preProcessBitstream in interface FormatFilter
      Parameters:
      c - context
      item - item containing bitstream to process
      source - source bitstream to be processed
      verbose - verbose mode
      Returns:
      true if bitstream processing should continue, false if this bitstream should be skipped
      Throws:
      Exception - if error
    • postProcessBitstream

      public void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream) throws Exception
      Perform any post-processing of the generated bitstream *after* this filter has already been run.

      Return true if pre-processing is successful (or no pre-processing is necessary). Return false if bitstream should be skipped for some reason.

      Specified by:
      postProcessBitstream in interface FormatFilter
      Parameters:
      c - context
      item - item containing bitstream to process
      generatedBitstream - the bitstream which was generated by this filter.
      Throws:
      Exception - if error