public class TikaMIMETypeDetector extends Object implements MIMETypeDetector
MIMETypeDetector
based on
Apache Tika.Modifier and Type | Field and Description |
---|---|
static String |
CSV_MIMETYPE |
static String |
RESOURCE_NAME |
Constructor and Description |
---|
TikaMIMETypeDetector() |
TikaMIMETypeDetector(Purifier purifier) |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkCSVFormat(InputStream is)
Checks if the stream contains a valid CSV pattern.
|
static boolean |
checkN3Format(InputStream is)
Checks if the stream contains the N3 triple patterns.
|
static boolean |
checkNQuadsFormat(InputStream is)
Checks if the stream contains the NQuads patterns.
|
static boolean |
checkTurtleFormat(InputStream is)
Checks if the stream contains Turtle triple patterns.
|
MIMEType |
guessMIMEType(String fileName,
InputStream input,
MIMEType mimeTypeFromMetadata)
Estimates the
MIME type of the content of input file. |
public static final String CSV_MIMETYPE
public static final String RESOURCE_NAME
public TikaMIMETypeDetector(Purifier purifier)
public TikaMIMETypeDetector()
public static boolean checkN3Format(InputStream is) throws IOException
is
- input stream to be verified.true
if N3 patterns are detected, false
otherwise.IOException
public static boolean checkNQuadsFormat(InputStream is) throws IOException
is
- input stream to be verified.true
if N3 patterns are detected, false
otherwise.IOException
public static boolean checkTurtleFormat(InputStream is) throws IOException
is
- input stream to be verified.true
if Turtle patterns are detected, false
otherwise.IOException
public static boolean checkCSVFormat(InputStream is) throws IOException
is
- input stream to be verified.true
if CSV patterns are detected, false
otherwise.IOException
public MIMEType guessMIMEType(String fileName, InputStream input, MIMEType mimeTypeFromMetadata)
MIME
type of the content of input file.
The input stream must be resettable.guessMIMEType
in interface MIMETypeDetector
fileName
- name of the data source.input
- null
or a resettable input stream containing data.mimeTypeFromMetadata
- mimetype declared in metadata.null
if nothing appropriate found.IllegalArgumentException
- if input is not null
and is not resettable.Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.