org.dspace.app.mediafilter
Class MediaFilter

java.lang.Object
  extended by org.dspace.app.mediafilter.MediaFilter
All Implemented Interfaces:
FormatFilter
Direct Known Subclasses:
BrandedPreviewJPEGFilter, HTMLFilter, JPEGFilter, PDFFilter, WordFilter, XPDF2Text, XPDF2Thumbnail

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 Summary
MediaFilter()
           
 
Method Summary
 void postProcessBitstream(Context c, Item item, Bitstream generatedBitstream)
          Perform any post-processing of the generated bitstream *after* this filter has already been run.
 boolean preProcessBitstream(Context c, Item item, Bitstream source)
          Perform any pre-processing of the source bitstream *before* the actual filtering takes place in MediaFilterManager.processBitstream().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dspace.app.mediafilter.FormatFilter
getBundleName, getDescription, getDestinationStream, getFilteredName, getFormatString
 

Constructor Detail

MediaFilter

public MediaFilter()
Method Detail

preProcessBitstream

public boolean preProcessBitstream(Context c,
                                   Item item,
                                   Bitstream source)
                            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
Returns:
true if bitstream processing should continue, false if this bitstream should be skipped
Throws:
Exception

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


Copyright © 2010 DuraSpace. All Rights Reserved.