public class ArchiveFilter extends AbstractFilter
MIME type of the format supported by the filter is not defined by the filter, but is specified via filter parameters. It allows to use the same filter for different container formats, e.g. DOCX, ODT, etc. by only changing a set of filter parameters.
Please note that when you configure this filter and specify sub-filter classes for the files of interest inside the container, you are responsible to provide visibility of class loaders of those sub-filter classes you specify, otherwise the ArchiveFilter won't be able to instantiate the sub-filters, and an exception will be thrown.
To configure the filter, specify in Parameters the comma-separated lists of file names (may contain wildcards) and their corresponding config Ids.
When specifying congigId for a file, you can choose one of the configurations provided by DefaultFilters class. If the desired configuration is not provided there, you can use setFilterConfigurationMapper() to set your own FilterConfiguationMapper, or alternatively you can get a reference to the default implementation of IFilterConfigurationMapper provided by this class, and use addConfiguration() and other methods to configure it to your desire.
| Modifier and Type | Field and Description |
|---|---|
static String |
MIME_TYPE |
SUB_FILTER| Constructor and Description |
|---|
ArchiveFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the current process.
|
void |
close()
Closes the input document.
|
IFilterWriter |
createFilterWriter()
Creates a new IFilterWriter object from the most appropriate class to
use with this filter.
|
ISkeletonWriter |
createSkeletonWriter()
Creates a new ISkeletonWriter object that corresponds to the type of skeleton
this filter uses.
|
String |
getDisplayName()
Gets the localizable display name of this filter.
|
EncoderManager |
getEncoderManager()
Gets the EncoderManager object for this filter.
|
IFilterConfigurationMapper |
getFilterConfigurationMapper()
Gets the filter configuration mapper if available.
|
String |
getMimeType()
Gets the input document mime type.
|
String |
getName()
Gets the name/identifier of this filter.
|
Parameters |
getParameters()
Gets the current parameters for this filter.
|
boolean |
hasNext()
Indicates if there is an event to process.
|
protected boolean |
isUtf8Bom()
Does the input have a UTF-8 Byte Order Mark?
|
protected boolean |
isUtf8Encoding()
Is the input encoded as UTF-8?
|
Event |
next()
Gets the next event available.
|
void |
open(RawDocument input)
Opens the input document described in a give RawDocument object.
|
void |
open(RawDocument input,
boolean generateSkeleton)
Opens the input document described in a give RawDocument object, and
optionally creates skeleton information.
|
void |
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper for this filter.
|
void |
setParameters(IParameters params)
Sets new parameters for this filter.
|
addConfiguration, addConfiguration, addConfiguration, addConfigurations, createEndFilterEvent, createStartFilterEvent, findConfiguration, getConfiguration, getConfigurations, getDocumentId, getDocumentName, getEncoding, getFilterWriter, getNewlineType, getParameters, getParametersClassName, getParentId, getSrcLoc, getTrgLoc, isCanceled, isGenerateSkeleton, isMultilingual, removeConfiguration, setDisplayName, setDocumentName, setEncoding, setFilterWriter, setGenerateSkeleton, setMimeType, setMultilingual, setName, setNewlineType, setOptions, setParentId, setSrcLoc, setTrgLocclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic static final String MIME_TYPE
public void cancel()
IFiltercancel in interface IFiltercancel in class AbstractFilterpublic void close()
IFilterclose in interface AutoCloseableclose in interface IFilterclose in class AbstractFilterpublic IFilterWriter createFilterWriter()
IFiltercreateFilterWriter in interface IFiltercreateFilterWriter in class AbstractFilterpublic ISkeletonWriter createSkeletonWriter()
IFiltercreateSkeletonWriter in interface IFiltercreateSkeletonWriter in class AbstractFilterpublic String getDisplayName()
IFiltergetDisplayName in interface IFiltergetDisplayName in class AbstractFilterpublic EncoderManager getEncoderManager()
IFiltergetEncoderManager in interface IFiltergetEncoderManager in class AbstractFilterpublic String getMimeType()
AbstractFiltergetMimeType in interface IFiltergetMimeType in class AbstractFilterpublic String getName()
IFiltergetName in interface IFiltergetName in class AbstractFilterpublic Parameters getParameters()
IFiltergetParameters in interface IFiltergetParameters in class AbstractFilterpublic boolean hasNext()
IFilterImplementer Note: The caller must be able to call this method several times without changing state.
public Event next()
IFilterpublic void open(RawDocument input)
IFilterinput - The RawDocument object to use to open the document.public void open(RawDocument input, boolean generateSkeleton)
IFilteropen in interface IFilteropen in class AbstractFilterinput - The RawDocument object to use to open the document.generateSkeleton - true to generate the skeleton data, false otherwise.public void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
IFiltersetFilterConfigurationMapper in interface IFiltersetFilterConfigurationMapper in class AbstractFilterfcMapper - the mapper to set.public IFilterConfigurationMapper getFilterConfigurationMapper()
AbstractFiltergetFilterConfigurationMapper in class AbstractFilterpublic void setParameters(IParameters params)
IFiltersetParameters in interface IFiltersetParameters in class AbstractFilterparams - The new parameters to use.protected boolean isUtf8Encoding()
AbstractFilterisUtf8Encoding in class AbstractFilterprotected boolean isUtf8Bom()
AbstractFilterisUtf8Bom in class AbstractFilterCopyright © 2021. All rights reserved.