package fr.insee.eno.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class FileArchiver {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(FileArchiver.class);
	
	/**
     * Add a file into Zip file.
     * 
     * @param filePath
     * @param zipStream
     * @throws FileNotFoundException
     * @throws IOException
     */
    public static void writeToZipFile(String filePath, ZipOutputStream zipStream)
            throws FileNotFoundException, IOException {
    	LOGGER.info("Writing file : '"+filePath+ "' to archive file.");

        File file = new File(filePath);

    	LOGGER.info("Parent directory :"+file.getParentFile().getName());
        FileInputStream fis = new FileInputStream(file);
        ZipEntry zipEntry = new ZipEntry(file.getParentFile().getName()+"/"+file.getName());
        zipStream.putNextEntry(zipEntry);
        zipStream.write(IOUtils.toByteArray(fis));
        zipStream.closeEntry();
        fis.close();
    }

}

@@ -628,24 +628,43 @@
 File(String 
+surveyName, String 
 filePath, Zi
@@ -744,16 +744,22 @@
 ption %7B%0A
+    %09%0A
     %09LOG
@@ -863,80 +863,8 @@
 th);
-%0A%0A    %09LOGGER.info(%22Parent directory :%22+file.getParentFile().getName());
 %0A   
@@ -886,17 +886,20 @@
 tream fi
-s
+leIS
  = new F
@@ -920,16 +920,25 @@
 (file);%0A
+        %0A
         
@@ -970,16 +970,35 @@
 ipEntry(
+surveyName + %22/%22 + 
 file.get
@@ -1022,16 +1022,21 @@
 ame()+%22/
+form/
 %22+file.g
@@ -1042,24 +1042,33 @@
 getName());%0A
+        %0A
         zipS
@@ -1143,17 +1143,20 @@
 Array(fi
-s
+leIS
 ));%0A    
@@ -1193,17 +1193,20 @@
       fi
-s
+leIS
 .close()

Update FileArchiver.java