If a pattern matches the given name, then the media type associated with
that pattern is returned as the likely content type of the input document.
Otherwise the returned type is
detect(InputStream, Metadata) method for more details
of the matching algorithm.
|Constructor and Description|
Creates a new content type detector based on the given name patterns.
|Modifier and Type||Method and Description|
Detects the content type of an input document based on the document name given in the input metadata.
patterns- map from name patterns to corresponding media types
public MediaType detect(InputStream input, Metadata metadata)
If a resource name is given, then it is first processed as follows.
The resulting name string (if any) is then matched in sequence against all the configured name patterns. If a match is found, then the (first) matching media type is returned.
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.