コード例 #1
0
 @Command
 public void downloadSelectedSurveyFile() {
   byte[] content = surveyManager.loadSurveyFileContent(selectedSurveyFile);
   String fileName = selectedSurveyFile.getFilename();
   String contentType = URLConnection.guessContentTypeFromName(fileName);
   Filedownload.save(content, contentType, fileName);
 }
コード例 #2
0
ファイル: BackupProcess.java プロジェクト: Arbonaut/collect
 private void includeIdml(ZipOutputStream zipOutputStream) {
   String entryFileName = "idml.xml";
   ZipEntry entry = new ZipEntry(entryFileName);
   try {
     zipOutputStream.putNextEntry(entry);
     surveyManager.marshalSurvey(survey, zipOutputStream);
     //			String surveyMarshalled = surveyManager.marshalSurvey(survey);
     //			PrintWriter printWriter = new PrintWriter(zipOutputStream);
     //			printWriter.write(surveyMarshalled);
     zipOutputStream.closeEntry();
     zipOutputStream.flush();
   } catch (IOException e) {
     String message = "Error while including idml into zip file: " + e.getMessage();
     if (LOG.isErrorEnabled()) {
       LOG.error(message, e);
     }
     throw new RuntimeException(message, e);
   }
 }
コード例 #3
0
 public List<SurveyFile> getSurveyFiles() {
   return survey == null ? null : surveyManager.loadSurveyFileSummaries(survey);
 }