// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Talk.java
// public class Talk {
// 
//     public final String path;
//     public final String title;
//     public final List<String> speakers;
//     public final Date date;
//     public final String content;
//     public final List<String> categories;
//     public final String organizer;
// 
//     public Talk(String path, String title, List<String> speakers, Date date, String content, List<String> categories, String organizer) {
//         this.path = path;
//         this.title = title;
//         this.speakers = speakers;
//         this.date = date;
//         this.content = content;
//         this.categories = categories;
//         this.organizer = organizer;
//     }
// }


import com.google.common.base.Optional;
import de.fhopf.lucenesolrtalk.Talk;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.sax.BodyContentHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;
package de.fhopf.lucenesolrtalk.lucene;



/**
 * Indexes files where the content is extracted by Tika.
 */
public class TikaIndexer {

    private final Indexer indexer;

    private final Logger logger = LoggerFactory.getLogger(TikaIndexer.class);

    public TikaIndexer(Indexer indexer) {
        this.indexer = indexer;
    }

    public void indexDir(String path)  {
        File [] files = new File(path).listFiles();
        AutoDetectParser parser = new AutoDetectParser();

        logger.debug("Found {} files in dir", files.length);

// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/Talk.java
// public class Talk {
// 
//     public final String path;
//     public final String title;
//     public final List<String> speakers;
//     public final Date date;
//     public final String content;
//     public final List<String> categories;
//     public final String organizer;
// 
//     public Talk(String path, String title, List<String> speakers, Date date, String content, List<String> categories, String organizer) {
//         this.path = path;
//         this.title = title;
//         this.speakers = speakers;
//         this.date = date;
//         this.content = content;
//         this.categories = categories;
//         this.organizer = organizer;
//     }
// }


// Path: lucene/src/main/java/de/fhopf/lucenesolrtalk/lucene/TikaIndexer.java
import com.google.common.base.Optional;
import de.fhopf.lucenesolrtalk.Talk;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.sax.BodyContentHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.*;

package de.fhopf.lucenesolrtalk.lucene;



/**
 * Indexes files where the content is extracted by Tika.
 */
public class TikaIndexer {

    private final Indexer indexer;

    private final Logger logger = LoggerFactory.getLogger(TikaIndexer.class);

    public TikaIndexer(Indexer indexer) {
        this.indexer = indexer;
    }

    public void indexDir(String path)  {
        File [] files = new File(path).listFiles();
        AutoDetectParser parser = new AutoDetectParser();

        logger.debug("Found {} files in dir", files.length);

        List<Talk> talks = new ArrayList<Talk>();