Package com. wangchao. Tika. Demo;
Import java. Io. bufferedreader;
Import java. Io. file;
Import java. Io. fileinputstream;
Import java. Io. filenotfoundexception;
Import java. Io. ioexception;
Import java. Io. reader;
Import org. Apache. Tika. Tika;
Import org. Apache. Tika. Metadata. metadata;
Import org. Apache. Tika. Metadata. tikacoreproperties;
Public class metadatademo {
/**
* @ Param ARGs
* @ Throws ioexception
* @ Throws filenotfoundexception
*/
Public static void main (string [] ARGs) throws filenotfoundexception, ioexception {
// The method stub automatically generated by todo
Tika = new Tika ();
Metadata M = new metadata ();
Reader r = Tika. parse (New fileinputstream (new file ("/home/wangchao/documentation/java socksock .doc"), M );
// Obtain the content
Bufferedreader BR = new bufferedreader (R );
String line = NULL;
While (line = Br. Readline ())! = NULL ){
System. Out. println (line );
}
// All metadata
System. Out. println (m );
}
}