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 java.lang.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.
|
java.lang.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.
|
java.lang.String |
getMimeType()
Gets the input document mime type.
|
java.lang.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, setTrgLoc
public static final java.lang.String MIME_TYPE
public void cancel()
IFilter
cancel
in interface IFilter
cancel
in class AbstractFilter
public void close()
IFilter
close
in interface java.lang.AutoCloseable
close
in interface IFilter
close
in class AbstractFilter
public IFilterWriter createFilterWriter()
IFilter
createFilterWriter
in interface IFilter
createFilterWriter
in class AbstractFilter
public ISkeletonWriter createSkeletonWriter()
IFilter
createSkeletonWriter
in interface IFilter
createSkeletonWriter
in class AbstractFilter
public java.lang.String getDisplayName()
IFilter
getDisplayName
in interface IFilter
getDisplayName
in class AbstractFilter
public EncoderManager getEncoderManager()
IFilter
getEncoderManager
in interface IFilter
getEncoderManager
in class AbstractFilter
public java.lang.String getMimeType()
AbstractFilter
getMimeType
in interface IFilter
getMimeType
in class AbstractFilter
public java.lang.String getName()
IFilter
getName
in interface IFilter
getName
in class AbstractFilter
public Parameters getParameters()
IFilter
getParameters
in interface IFilter
getParameters
in class AbstractFilter
public boolean hasNext()
IFilter
Implementer Note: The caller must be able to call this method several times without changing state.
public Event next()
IFilter
public void open(RawDocument input)
IFilter
input
- The RawDocument object to use to open the document.public void open(RawDocument input, boolean generateSkeleton)
IFilter
open
in interface IFilter
open
in class AbstractFilter
input
- The RawDocument object to use to open the document.generateSkeleton
- true to generate the skeleton data, false otherwise.public void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
IFilter
setFilterConfigurationMapper
in interface IFilter
setFilterConfigurationMapper
in class AbstractFilter
fcMapper
- the mapper to set.public IFilterConfigurationMapper getFilterConfigurationMapper()
AbstractFilter
getFilterConfigurationMapper
in class AbstractFilter
public void setParameters(IParameters params)
IFilter
setParameters
in interface IFilter
setParameters
in class AbstractFilter
params
- The new parameters to use.protected boolean isUtf8Encoding()
AbstractFilter
isUtf8Encoding
in class AbstractFilter
protected boolean isUtf8Bom()
AbstractFilter
isUtf8Bom
in class AbstractFilter
Copyright © 2022. All rights reserved.