@Override
protected IDataSet loadDataSet(final Source source) throws DataSetException,
IOException {
final int dotPos = source.getSourceFile().lastIndexOf(".");
final int slashPos = source.getSourceFile().lastIndexOf("/");
final CsvParser parser = new CsvParserImpl();
final List readData;
final String tableName;
if (source.getSourceFile().startsWith(CLASSPATH_PREFIX)) {
final URL url = getClass().getResource(source.getSourceFile().substring(CLASSPATH_PREFIX_LENGTH));
readData = parser.parse(url);
if (slashPos == -1) {
tableName = source.getSourceFile().substring(CLASSPATH_PREFIX_LENGTH, dotPos);
} else {
tableName = source.getSourceFile().substring(slashPos + 1, dotPos);
}
} else {
final File sourceFile = new File(source.getSourceFile());
readData = parser.parse(sourceFile);
if (slashPos == -1) {
tableName = source.getSourceFile().substring(0, dotPos);
} else {
tableName = source.getSourceFile().substring(slashPos + 1, dotPos);
}