com.agimatec.database.DataSetFactory Maven / Gradle / Ivy
package com.agimatec.database;
import org.dbunit.dataset.DataSetException;
import java.io.IOException;
/**
* Description:
* User: roman.stumm
* Date: 01.06.2007
* Time: 12:27:10
* Copyright: Agimatec GmbH
*/
public class DataSetFactory {
/**
* .xml --> FlatXmlDataSet
* .xxml --> XmlDataSet
* .xls --> XslDataSet
*
*
* @param dataFile
* @return adequate dataset
* @throws IOException
* @throws DataSetException
*/
public static DataSet createDataSet(String dataFile) {
if (dataFile.endsWith(".xml")) {
return new DataSetFlatXML(dataFile);
} else if (dataFile.endsWith(".xxml")) {
return new DataSetXML(dataFile);
} else if (dataFile.endsWith(".xls")) {
return new DataSetXSL(dataFile);
} else {
throw new IllegalArgumentException("Unsupport file format for " + dataFile);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy