public interface DecisionTreeNode
DecisionTreeNode
represents the state of the detection of a
ContentType
. Out of the format
descriptions
of all ContentType
s a decision tree is generated for
fast and efficient detection of the ContentType
. Therefore each
DecisionTreeNode
represents a current state of detection and is
associated
with the ContentType
best
matching the current data. When new data
is
available, the detection
can be continued. Step by step a more detailed DecisionTreeNode
is
returned until the final ContentType
is discovered or it is ensured
that the data does not match any of the known ContentType
s.Modifier and Type | Method and Description |
---|---|
DecisionTreeNode |
detect(DetectorStreamBuffer buffer,
Map<String,Object> metadata,
boolean eos)
This method processes the given
buffer to proceed with the
detection of the content-type. |
ContentType |
getContentType()
This method gets the
ContentType associated with this node (as far
as detected). |
ContentType getContentType()
ContentType
associated with this node (as far
as detected). If nothing has yet been detected, the root
ContentType
shall be returned.ContentType
.DecisionTreeNode detect(DetectorStreamBuffer buffer, Map<String,Object> metadata, boolean eos)
buffer
to proceed with the
detection of the content-type.buffer
- is the DetectorStreamBuffer
containing the next bytes
to process.metadata
- is a Map
with metadata. New metadata read from the
stream is added to this Map
if NOT already defined. If
metadata in this Map
is already present before it is
detected, the buffer
shall be modified to reflect this
metadata value.eos
- - true
if the end of the stream has been reached
and the given buffer
contains the remaining data.DecisionTreeNode
representing the current state of
detection or null
if the stream does NOT match any
known filetype.DetectorStreamProcessor.process(DetectorStreamBuffer,
Map, boolean)
Copyright © 2001–2014 mmm-Team. All rights reserved.