break;
}
case 3: {
// Eseguo script python
// python script.py ../HTMLs/33.html
ExecuteWA wa = new ExecuteWA();
// Eseguo i wa
String file = (String) params;
wa.executePythonScriptTest(file);
// Recupero la sequenza dei file wa HTML
ArrayList<String> listWaHtml = getListWAHtml(file);
ArrayList<String> temp = new ArrayList<String>();
// Formatto la lista, torno solo gli id
for (int l = 0; l < listWaHtml.size(); l++) {
String fileName = listWaHtml.get(l);
if (!fileName.equals("Nessuno")) {
temp.add(fileName.substring(fileName.indexOf("-id") + 3, fileName.length()));
}
}
return temp;
//break;
}
case 7: {
// Cancello i file wa hmtml
File htmlDir = new File(ExecuteWA.path_html);
File[] files = htmlDir.listFiles();
File tmp_f = null;
for (int i = 0; i < files.length; i++) {
tmp_f = files[i];
if (!tmp_f.isDirectory()) {
String temp = tmp_f.getName();
// Cancello i file creati dallo script python
if ((temp.contains("_")) && (temp.contains("-id"))) {
if (tmp_f.canWrite()) {
tmp_f.delete();
}
}
}
}
break;
}
case 8: {
// Aggiorno il database
Object[] temp = (Object[]) params;
String idScript = (String) temp[0];
ArrayList<String> listWaHtml = (ArrayList<String>) temp[1];
ExecuteWA db = new ExecuteWA();
db.upDateDbTest(idScript, listWaHtml);
break;
}
case 10: {
// Torno una lista random dei file html
File htmlDir = new File(ExecuteWA.path_html);