/**
 * 
 */
package eu.dnetlib.data.collective.manager.log;

import java.io.File;

/**
 * @author js
 *
 */
public class AbstractInfoService {
   	private String indexDirectory;
   	protected File dir;
	protected boolean create = true; // indicates to create the index-directory

   	public void init(){
		dir = new File(indexDirectory);
		
		if (!dir.exists()){
			if (!dir.mkdirs()){
				throw new IllegalStateException("cannot create dir: " + indexDirectory);
			}
		}
		if (dir.list().length > 0){
			create = false;
		}
   	}
	public String getIndexDirectory() {
		return indexDirectory;
	}

	public void setIndexDirectory(String indexDirectory) {
		this.indexDirectory = indexDirectory;
	}

}
