如何使用apache tika解析.Pst文件 1.2?
如何在使用ljcene進行搜索時獲取整個主體,附件和電子郵件的所有元數據?如何從中提取內容。使用apache tika的Pst文件?
for (File file : docs.listFiles()) {
Metadata metadata = new Metadata();
ContentHandler handler = new BodyContentHandler();
ParseContext context = new ParseContext();
Parser parser = new AutoDetectParser();
InputStream stream = new FileInputStream(file);
try {
parser.parse(stream, handler, metadata, context);
}
catch (TikaException e) {
e.printStackTrace();
}
catch (SAXException e) {
e.printStackTrace();
}
雅我與自動檢測解析器嘗試(File file:docs.listFiles()){ 元數據元數據=新的元數據();與BodyContenthandle,元數據和文檔對象 – user2857190
。 ContentHandler handler = new BodyContentHandler(); ParseContext context = new ParseContext(); 解析器解析器= new AutoDetectParser(); InputStream stream = new FileInputStream(file); \t \t \t嘗試{ \t \t \t \t parser.parse(流,處理程序,元數據,背景); \t \t \t} \t \t \t趕上(TikaException E){ \t \t \t \t e.printStackTrace(); \t \t \t}趕上(SAXException的發送){ \t \t \t \t e.printStackTrace(); \t \t \t} – user2857190