Package org.dspace.app.mediafilter
Class MediaFilter
java.lang.Object
org.dspace.app.mediafilter.MediaFilter
- All Implemented Interfaces:
FormatFilter
- Direct Known Subclasses:
BrandedPreviewJPEGFilter,ImageMagickThumbnailFilter,JPEGFilter,PDFBoxThumbnail,TikaTextExtractionFilter
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpostProcessBitstream(Context c, Item item, Bitstream generatedBitstream) Perform any post-processing of the generated bitstream *after* this filter has already been run.booleanpreProcessBitstream(Context c, Item item, Bitstream source, boolean verbose) 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, waitMethods inherited from interface org.dspace.app.mediafilter.FormatFilter
getBundleName, getDescription, getDestinationStream, getFilteredName, getFormatString
-
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:
preProcessBitstreamin interfaceFormatFilter- Parameters:
c- contextitem- item containing bitstream to processsource- source bitstream to be processedverbose- 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:
postProcessBitstreamin interfaceFormatFilter- Parameters:
c- contextitem- item containing bitstream to processgeneratedBitstream- the bitstream which was generated by this filter.- Throws:
Exception- if error
-