Browse Source

final changes

master
antfri01 2 years ago
parent
commit
1f5c79d677
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      src/antoniofrische/com/ActListar.java

+ 4
- 4
src/antoniofrische/com/ActListar.java View File

@ -7,20 +7,20 @@ public class ActListar {
File archPrincip; File archPrincip;
if(args.length>0) { if(args.length>0) {
archPrincip = new File(args[0]); archPrincip = new File(args[0]);
//pasa a la carpeta de fecto si los args estan bacios.
}else { }else {
archPrincip = new File("C:\\Users\\AntonioFrische\\OneDrive - ABACCO Solutions\\Pictures"); archPrincip = new File("C:\\Users\\AntonioFrische\\OneDrive - ABACCO Solutions\\Pictures");
} }
listDirectorio(archPrincip, ""); listDirectorio(archPrincip, "");
} }
//metodo que representa la capeta elegida y sus subcarpetas si tiene
public static void listDirectorio(File path, String location) { public static void listDirectorio(File path, String location) {
File[] archList = path.listFiles(); File[] archList = path.listFiles();
for(int i = 0; i < archList.length; i++) { for(int i = 0; i < archList.length; i++) {
System.out.println(location + archList[i].getName());//representa el archivo o la carpeta.
if(archList[i].isDirectory()) { if(archList[i].isDirectory()) {
System.out.println(location + archList[i].getName());
listDirectorio(archList[i],location+" -");
}else {
System.out.println(location + archList[i].getName());
listDirectorio(archList[i],location+" -"); //llama a el mismo otravez para representar las subcarpetas.
} }
} }
} }


Loading…
Cancel
Save