@Command public void downloadSelectedSurveyFile() { byte[] content = surveyManager.loadSurveyFileContent(selectedSurveyFile); String fileName = selectedSurveyFile.getFilename(); String contentType = URLConnection.guessContentTypeFromName(fileName); Filedownload.save(content, contentType, fileName); }
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); } }
public List<SurveyFile> getSurveyFiles() { return survey == null ? null : surveyManager.loadSurveyFileSummaries(survey); }