modif sur les datas csv

This commit is contained in:
yann 2020-12-27 15:07:15 +01:00 committed by name
parent 15f5c1068a
commit b5cca0443b
2 changed files with 10 additions and 5 deletions

View file

@ -8,19 +8,22 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
public class DataCsv { public class DataCsv {
protected String destination;
/** /**
* Le constructeur de DataCsv * Le constructeur de DataCsv
*/ */
public DataCsv(){ public DataCsv(){
this.destination = "src/test/resources/CsvFile";
} }
/** /**
* La methode de recuperation dun fichier csv * La methode de recuperation dun fichier csv
* @param fileZip : nom suivit du chemin du fichier zip
*/ */
public void getCsv(String fileZip) throws IOException{ public void getCsv(String fileZip) throws IOException{
//"src/main/resources/loto_201911.zip" File desDir = new File(destination);
File desDir = new File("src/main/resources/");
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip)); ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip));
ZipEntry zipEntry = zis.getNextEntry(); 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{ public File newFile(File destinationDir, ZipEntry zipEntry) throws IOException{
File destFile = new File(destinationDir, zipEntry.getName()); File destFile = new File(destinationDir, zipEntry.getName());

View file

@ -15,7 +15,7 @@ public class ImportData {
*/ */
ImportData(){ ImportData(){
this.url = "https://www.fdj.fr/jeux-de-tirage/loto/statistiques"; this.url = "https://www.fdj.fr/jeux-de-tirage/loto/statistiques";
this.repDes = "src/test/resources/"; this.repDes = "src/test/resources/Download/";
} }
/** /**