|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.mime.TikaMIMETypeDetector
public class TikaMIMETypeDetector
Implementation of MIMETypeDetector
based on
Apache Tika.
Field Summary | |
---|---|
static String |
CSV_MIMETYPE
|
static String |
N3_MIMETYPE
|
static String |
NQUADS_MIMETYPE
|
static String |
RESOURCE_NAME
|
static String |
TURTLE_MIMETYPE
|
Constructor Summary | |
---|---|
TikaMIMETypeDetector()
|
|
TikaMIMETypeDetector(Purifier purifier)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String N3_MIMETYPE
public static final String NQUADS_MIMETYPE
public static final String TURTLE_MIMETYPE
public static final String CSV_MIMETYPE
public static final String RESOURCE_NAME
Constructor Detail |
---|
public TikaMIMETypeDetector(Purifier purifier)
public TikaMIMETypeDetector()
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |