fin arbre
This commit is contained in:
27
DEV3.2/arbre/repertoire/Repertoires.java
Normal file
27
DEV3.2/arbre/repertoire/Repertoires.java
Normal file
@@ -0,0 +1,27 @@
|
||||
import java.io.File;
|
||||
|
||||
public class Repertoires {
|
||||
|
||||
public static void main(String[] args) {
|
||||
if (args.length != 1) {
|
||||
System.out.println("Usage: java Repertoires <nom_du_répertoire>");
|
||||
return;
|
||||
}
|
||||
|
||||
File racine = new File(args[0]);
|
||||
System.out.println("Chemin fourni : " + racine.getAbsolutePath()); // Débogage
|
||||
|
||||
if (!racine.exists()) {
|
||||
System.out.println("Le répertoire spécifié n'existe pas : " + racine.getAbsolutePath());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!racine.isDirectory()) {
|
||||
System.out.println("Le chemin spécifié n'est pas un répertoire : " + racine.getAbsolutePath());
|
||||
return;
|
||||
}
|
||||
|
||||
Noeud arbre = Noeud.construireArbre(racine);
|
||||
arbre.afficher("");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user