From 4c5c9cf2b339a9ead36fefa9ed1e746828fcbdfa Mon Sep 17 00:00:00 2001 From: yann Date: Sun, 27 Dec 2020 15:07:15 +0100 Subject: [PATCH] modif sur les datas csv --- ProjetGenieLogicielLoto.iml | 47 +++++++++++----------- src/main/java/fr/myny/data/DataCsv.java | 13 ++++-- src/main/java/fr/myny/data/ImportData.java | 2 +- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/ProjetGenieLogicielLoto.iml b/ProjetGenieLogicielLoto.iml index 4766121..79671bd 100644 --- a/ProjetGenieLogicielLoto.iml +++ b/ProjetGenieLogicielLoto.iml @@ -1,25 +1,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/fr/myny/data/DataCsv.java b/src/main/java/fr/myny/data/DataCsv.java index a6411cf..d7f6300 100644 --- a/src/main/java/fr/myny/data/DataCsv.java +++ b/src/main/java/fr/myny/data/DataCsv.java @@ -8,19 +8,22 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; public class DataCsv { + + protected String destination; + /** * Le constructeur de DataCsv */ public DataCsv(){ - + this.destination = "src/test/resources/CsvFile"; } /** * La methode de recuperation dun fichier csv + * @param fileZip : nom suivit du chemin du fichier zip */ public void getCsv(String fileZip) throws IOException{ - //"src/main/resources/loto_201911.zip" - File desDir = new File("src/main/resources/"); + File desDir = new File(destination); byte[] buffer = new byte[1024]; ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip)); ZipEntry zipEntry = zis.getNextEntry(); @@ -50,7 +53,9 @@ public class DataCsv { } /** - * Methode d'extraction de fichier zip + * Methode verifiant si l extraction a bien ete faite + * @param destinationDir : chemin de destination + * @param zipEntry : zip cible */ public File newFile(File destinationDir, ZipEntry zipEntry) throws IOException{ File destFile = new File(destinationDir, zipEntry.getName()); diff --git a/src/main/java/fr/myny/data/ImportData.java b/src/main/java/fr/myny/data/ImportData.java index 19cd60c..35e3508 100644 --- a/src/main/java/fr/myny/data/ImportData.java +++ b/src/main/java/fr/myny/data/ImportData.java @@ -15,7 +15,7 @@ public class ImportData { */ ImportData(){ this.url = "https://www.fdj.fr/jeux-de-tirage/loto/statistiques"; - this.repDes = "src/test/resources/"; + this.repDes = "src/test/resources/Download/"; } /**