return null;
}
String fileName = get(upload + "FileName");
InputStream is = new FileInputStream(file);
if (fileName.endsWith(".xls")) {
EntityImporter importer = (clazz == null) ? new DefaultEntityImporter()
: new DefaultEntityImporter(clazz);
importer.setReader(new ExcelItemReader(is, 1));
put("importer", importer);
return importer;
} else {
LineNumberReader reader = new LineNumberReader(new InputStreamReader(is));
if (null == reader.readLine()) return null;
reader.reset();
EntityImporter importer = (clazz == null) ? new DefaultEntityImporter()
: new DefaultEntityImporter(clazz);
importer.setReader(new CsvItemReader(reader));
return importer;
}
} catch (Exception e) {
logger.error("error", e);
return null;