Package lumis.util.parse
Class TikaUtil
- java.lang.Object
-
- lumis.util.parse.TikaUtil
-
public class TikaUtil extends Object
Utility class for integrating with Apache Tika.- Since:
- 7.0.3
- Version:
- $Revision: 15976 $ $Date: 2013-11-06 16:30:50 -0200 (Wed, 06 Nov 2013) $
-
-
Constructor Summary
Constructors Constructor Description TikaUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
extractText(File file)
Extracts the text from the given file.static String
extractText(InputStream inputStream)
Extracts text from the given input stream.static String
getContentType(File file)
Extracts the content type from the given file.static String
getContentType(InputStream inputStream)
Extracts the content type from the given input stream.
-
-
-
Method Detail
-
extractText
public static String extractText(File file) throws ParseException, FileNotFoundException, IllegalArgumentException
Extracts the text from the given file.- Parameters:
file
- the file.- Returns:
- the extracted text.
- Throws:
ParseException
- if some error occur during parsing.IllegalArgumentException
- if the file isnull
or if it does not represent a file.FileNotFoundException
- if the file does not exist.- Since:
- 7.0.3
-
extractText
public static String extractText(InputStream inputStream) throws ParseException, IllegalArgumentException
Extracts text from the given input stream.- Parameters:
inputStream
- the input stream.- Returns:
- the extracted text.
- Throws:
ParseException
- if some error occur during parsing.IllegalArgumentException
- if the input stream isnull
.- Since:
- 7.0.3
-
getContentType
public static String getContentType(File file) throws ParseException, FileNotFoundException
Extracts the content type from the given file.- Parameters:
file
- the file.- Returns:
- the content type.
- Throws:
ParseException
- if some error occur during parsing.IllegalArgumentException
- if the file isnull
or if it does not represent a file.FileNotFoundException
- if the file does not exist.- Since:
- 7.0.3
-
getContentType
public static String getContentType(InputStream inputStream) throws ParseException
Extracts the content type from the given input stream.- Parameters:
inputStream
- the input stream.- Returns:
- the content type.
- Throws:
ParseException
- if some error occur during parsing.IllegalArgumentException
- if the input stream isnull
.- Since:
- 7.0.3
-
-