* @see IndexWriterFactoryUtils#getIndexWriter(IndexFactory)
* @see IndexWriterFactoryUtils#releaseIndexWriter(IndexFactory, IndexWriter)
*/
public void index(String dirToParse, boolean optimizeIndex) {
if( !checkBaseDirectory(dirToParse) ) {
throw new LuceneIndexingException("The base directory doesn't exist!");
}
LuceneIndexWriter writer = IndexWriterFactoryUtils.getIndexWriter(getIndexFactory());
try {
File file = new File(dirToParse);