Last active
August 29, 2015 14:05
-
-
Save mmalmeida/6c894f5237d7af060559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected ZipOutputStream createZipFile(File file, List<DataCollectionItf> answers) | |
| throws ExportException { | |
| ZipOutputStream zipFile; | |
| try { | |
| zipFile = newZipFile(file); | |
| } catch (FileNotFoundException e1) { | |
| throw new ExportException("Zip file could not be initialised",e1); | |
| } | |
| List<String> filesAdded = new ArrayList<String>(); | |
| for (DataCollectionItf answer : answers) { | |
| if(answer.getFreeText() != null && !answer.getFreeText().isEmpty()){ | |
| zipFile - create entry (...) | |
| zipFile.closeEntry(); | |
| } catch (IOException e) { | |
| throw new ExportException(...); | |
| } | |
| } | |
| } | |
| try { | |
| zipFile.close(); | |
| } catch (IOException e) { | |
| throw new ExportException("Error closing the Zip file",e); | |
| } | |
| return zipFile; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment