Search in sources :

Example 6 with CodeListImportException

use of org.openforis.collect.io.exception.CodeListImportException in project collect by openforis.

the class CodeListManager method importCodeLists.

@Transactional
public void importCodeLists(CollectSurvey survey, File file) throws CodeListImportException {
    FileInputStream is = null;
    try {
        is = new FileInputStream(file);
        importCodeLists(survey, is);
    } catch (FileNotFoundException e) {
        throw new CodeListImportException(e);
    } finally {
        IOUtils.closeQuietly(is);
    }
}
Also used : CodeListImportException(org.openforis.collect.io.exception.CodeListImportException) FileNotFoundException(java.io.FileNotFoundException) FileInputStream(java.io.FileInputStream) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

CodeListImportException (org.openforis.collect.io.exception.CodeListImportException)6 Transactional (org.springframework.transaction.annotation.Transactional)6 CollectSurvey (org.openforis.collect.model.CollectSurvey)4 SurveyImportException (org.openforis.collect.persistence.SurveyImportException)4 IdmlParseException (org.openforis.idm.metamodel.xml.IdmlParseException)4 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 SurveySummary (org.openforis.collect.model.SurveySummary)1 CollectCodeListService (org.openforis.collect.service.CollectCodeListService)1 CodeList (org.openforis.idm.metamodel.CodeList)1 CodeListImporter (org.openforis.idm.metamodel.xml.CodeListImporter)1