Browse Source

actividad media acabada

master
AntonioFrische 2 years ago
parent
commit
71fa87582a
2 changed files with 9 additions and 3 deletions
  1. BIN
      bin/antoniofrische/com/ActListar.class
  2. +9
    -3
      src/antoniofrische/com/ActListar.java

BIN
bin/antoniofrische/com/ActListar.class View File


+ 9
- 3
src/antoniofrische/com/ActListar.java View File

@ -4,15 +4,21 @@ import java.io.File;
public class ActListar { public class ActListar {
public static void main(String args[]) { public static void main(String args[]) {
File archPrincip;
if(args.length>0) {
archPrincip = new File(args[0]);
}else {
archPrincip = new File("C:\\Users\\AntonioFrische\\OneDrive - ABACCO Solutions\\Pictures");
}
listDirectorio(archPrincip, "");
} }
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++) {
if(archList[i].isDirectory()) { if(archList[i].isDirectory()) {
System.out.println(location + archList[i].getName()); System.out.println(location + archList[i].getName());
ListDirectorio(archList[i]," ");
listDirectorio(archList[i],location+" -");
}else { }else {
System.out.println(location + archList[i].getName()); System.out.println(location + archList[i].getName());
} }


Loading…
Cancel
Save