* normal file; should not be directory
* @return ready-to-index document
*/
protected Document processFile(File file, DocumentFactory docFactory) {
if (file.isFile()) {
DocumentBuilder builder = fileHandler.handle(file);
if (builder == null) {
log.debug("File " + file.getPath()
+ " cannot be recognized; ignored");
return null;
}
try {
FileInputStream fis = new FileInputStream(file);
log.debug("Building document from file: "
+ file.getAbsolutePath());
Document doc = docFactory.createDocument();
builder.buildDocument(fis, doc);
return doc;
} catch (FileNotFoundException e) {
log.error("File in use or not found");
return null;
} catch (DocumentHandlerException e) {