Package org.dspace.app.mediafilter
Interface FormatFilter
- All Known Implementing Classes:
BrandedPreviewJPEGFilter,ImageMagickImageThumbnailFilter,ImageMagickPdfThumbnailFilter,ImageMagickThumbnailFilter,ImageMagickVideoThumbnailFilter,JPEGFilter,MediaFilter,PDFBoxThumbnail,TikaTextExtractionFilter
public interface FormatFilter
Public interface for any class which transforms or converts content/bitstreams
from one format to another. This interface should be implemented by any class
which defines a "filter" to be run by the MediaFilterManager.
-
Method Summary
Modifier and TypeMethodDescriptiongetDestinationStream(Item item, InputStream source, boolean verbose) Read the source stream and produce the filtered content.getFilteredName(String sourceName) Get a filename for a newly created filtered bitstreamvoidpostProcessBitstream(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().
-
Method Details
-
getFilteredName
Get a filename for a newly created filtered bitstream- Parameters:
sourceName- name of source bitstream- Returns:
- filename generated by the filter - for example, document.pdf becomes document.pdf.txt
-
getBundleName
String getBundleName()- Returns:
- name of the bundle this filter will stick its generated Bitstreams
-
getFormatString
String getFormatString()- Returns:
- name of the bitstream format (say "HTML" or "Microsoft Word") returned by this filter look in the bitstream format registry or mediafilter.cfg for valid format strings.
-
getDescription
String getDescription()- Returns:
- string to describe the newly-generated Bitstream - how it was produced is a good idea
-
getDestinationStream
Read the source stream and produce the filtered content.- Parameters:
item- Itemsource- input streamverbose- verbosity flag- Returns:
- result of filter's transformation as a byte stream.
- Throws:
Exception- if error
-
preProcessBitstream
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.
- 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
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.
- Parameters:
c- contextitem- item containing bitstream to processgeneratedBitstream- the bitstream which was generated by this filter.- Throws:
Exception- if error
-