}
}
}
private void indexDocs_extracting_and_adding(String filePath) {
Parser selectedParser;
String fileName = filePath.substring(filePath.lastIndexOf(Vars.fileSeparator)+1);
File someFileForTypeRecognizing = new File(filePath);
String hash;
String newFilePath;
Vars.totalSizeOfProcessedFiles += someFileForTypeRecognizing.length();
try {
String type = Vars.tika.detect(someFileForTypeRecognizing);
if (Vars.parsersFromXML.get(type) != null) {
selectedParser = (Parser) (Class.forName(
Vars.parsersFromXML.get(type).
get("class").toString())).newInstance();
Vars.current_run_indexes++;
if (selectedParser.getClass().getName().indexOf("ZIP") < 1) {
hash = (new Date()).getTime() + Long.toHexString(random.nextLong())
+ Long.toHexString(random.nextLong());
MoveDir moveDir = new MoveDir();
newFilePath = Vars.pathToDayDir + "/" + hash;
moveDir.copyFile(someFileForTypeRecognizing, new File(newFilePath));
someFileForTypeRecognizing.delete();
filePath = newFilePath;
}
selectedParser.start_th(filePath, fileName);
type = null;
} else {
System.out.println("UNKNOWN TYPE " + type + " " + filePath);
}
} catch (Exception ex) {