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 37 38 39 40 41 42 43
|
public class Main {
public static void main(String[] args){
args = remplitArgs(new File("./"));
compileFichier(new File("./"),args);
}
/**
* @param repertoire repertoire ou l on veut trouver les fichier
* @return un tableau qui contient toutes les valeures a considerer comme argument
*/
public static String[] remplitArgs( File repertoire){
Vector<String> v = new Vector<String>();
if ( repertoire.isDirectory() ) {
File[] list = repertoire.listFiles();
if (list != null){
// on tourne sur tout les fichiers du repertoire en cour
for ( int i = 0; i < list.length; i++) {
if(list[i].toString().substring( list[i].toString().lastIndexOf(".")).equals(".lzx")) {
v.add(list[i].toString());
}
}
}
}
String[] table = new String[v.size()];
for ( int i = 0; i < v.size(); i++) {
table[i] = v.get(i);
}
return table;
}
/**
* Dans cette méthode on appel une classe "org.openlaszlo.compiler.Main" qui compile les fichier qu'on lui passe en arguments
* @param repertoire repertoire ou l on veut trouver les fichier
* @param list String[] contenant les valeurs a donnee en arguments
*/
public static void compileFichier(File repertoire,String[] list) {
if (list.length > 0){
// le pb est que cette fonction ne reconnait pas les arguement... Donc elle ne fait rien
org.openlaszlo.compiler.Main mainCompiler = new org.openlaszlo.compiler.Main( );
}
}
} |
Partager