use of org.openforis.collect.io.BackupFileExtractor in project collect by openforis.
the class BackupDataExtractor method init.
public void init() throws ZipException, IOException {
this.fileExtractor = new BackupFileExtractor(zipFile);
this.oldFormat = this.fileExtractor.isOldFormat();
this.dataUnmarshaller = new DataUnmarshaller(survey);
this.zipEntries = zipFile.entries();
this.initialized = true;
}
use of org.openforis.collect.io.BackupFileExtractor in project collect by openforis.
the class SurveyBackupVerifierTask method execute.
@Override
protected void execute() throws Throwable {
BackupFileExtractor fileExtractor = new BackupFileExtractor(zipFile);
checkEntryExists(fileExtractor, SurveyBackupJob.INFO_FILE_NAME);
checkEntryExists(fileExtractor, SurveyBackupJob.SURVEY_XML_ENTRY_NAME);
}
use of org.openforis.collect.io.BackupFileExtractor 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