1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
public void mooveLinesAndArrets(String pathData,String ip,Settings set,FTextArea test){
test.addext("entre dans fonction");
File dataFolder=new File(pathData);
test.addext("trace\n");
String lineExpected="lignes_"+this.getNumUU();
String arretExpected="arrets_"+this.getNumUU();
String newLocation=ip+"\\"+set.getdataSimu()+"\\"+this.getNumUU();
test.addext("Essai de rentrer dans "+pathData+"\n");
if(dataFolder.isDirectory()){
test.addext("Ouverture de "+pathData+"\n");
for(File f : dataFolder.listFiles()){
String filepath=f.getAbsolutePath();
if(filepath.contains(lineExpected)){
//moove the file
String comMoove="move "+"\"" +filepath+"\""+" \""+newLocation+"\"";
test.addext("Traitement de "+"move "+"\"" +filepath+"\""+" \""+newLocation+"\"");
Launch cmov=new Launch(comMoove);
cmov.exe();
}else{
if(filepath.contains(arretExpected)){
//moove the file
String comMoove="move "+"\"" +filepath+"\""+" \""+newLocation+"\"";
Launch cmov=new Launch(comMoove);
cmov.exe();
}
}
}
}else{
test.addext("Attention :"+dataFolder.getAbsolutePath()+" n'est pas un répertoire ! Impossible de déplacer les lignes et arrêts\n"
+ "Vérifiez le fichier settings.txt !");
}
} |