use of org.openforis.collect.io.SurveyBackupInfo in project collect by openforis.
the class SurveyBackupInfoCreatorTask method execute.
@Override
protected void execute() throws Throwable {
SurveyBackupInfo info = new SurveyBackupInfo();
info.setSurveyUri(survey.getUri());
info.setSurveyName(survey.getName());
info.store(outputStream);
}
use of org.openforis.collect.io.SurveyBackupInfo in project collect by openforis.
the class DataRestoreController method extractSurveyUri.
private String extractSurveyUri(File tempFile) throws ZipException, IOException, FileNotFoundException {
BackupFileExtractor backupFileExtractor = null;
try {
backupFileExtractor = new BackupFileExtractor(tempFile);
File infoFile = backupFileExtractor.extractInfoFile();
SurveyBackupInfo backupInfo = SurveyBackupInfo.parse(new FileInputStream(infoFile));
String surveyUri = backupInfo.getSurveyUri();
return surveyUri;
} finally {
IOUtils.closeQuietly(backupFileExtractor);
}
}
Aggregations