package org.ensembl.healthcheck.testcase.funcgen;

import java.sql.Connection;

import org.ensembl.healthcheck.DatabaseRegistryEntry;
import org.ensembl.healthcheck.ReportManager;

/**
 * @author mnuhn
 * 
 * Abstract class providing method "getSpeciesAssemblyDataFileBasePath". This 
 * can be used to write checks for external files.
 *
 */
public abstract class AbstractExternalFileUsingTestcase extends AbstractCoreDatabaseUsingTestCase {
	
	protected String getSpeciesAssemblyDataFileBasePath(DatabaseRegistryEntry dbre) {
		
		Connection coreConnection = getCoreDb(dbre).getConnection();
		
		String productionName = getProductionName(coreConnection);
		String assemblyName   = getAssembly(coreConnection);
		String dbFileRootDir  = getDataFileBasePath();
		
		if (dbFileRootDir.equals("")) {
			ReportManager.problem(this, dbre.getConnection(), "datafile_base_path has not been set!");
		}
		String speciesAssemblyDataFileBasePath = dbFileRootDir + "/" + productionName + "/" + assemblyName;
		
		return speciesAssemblyDataFileBasePath;
	}
}

@@ -69,24 +69,68 @@
 onnection;%0A%0A
+import org.apache.commons.lang.StringUtils;%0A
 import org.e
@@ -807,16 +807,36 @@
 %09%09%0A%09%09if 
+(StringUtils.isEmpty
 (dbFileR
@@ -845,18 +845,8 @@
 tDir
-.equals(%22%22
 )) %7B

make check for filepath much more robust