Hello sorry for my english but I need a little help here, this must be easy for you but I for the life of me cannot figure it out. What I am trying to do is list the disk partitions and listing all the name of directory and files within them. Thus far I have reached this:
File[] root= File.listRoots();
System.out.println("Se encontraron " + root.length + " Particiones de Disco " );
for( int i = 0 ; i < root.length ; i++ ){
System.out.println( root[i].toString() + " existe= " + root[i].exists() );
if(root[i].exists()==true){
System.out.println("Espacio Total: "+ root[i].getTotalSpace());
System.out.println("Espacio Libre: "+ root[i].getFreeSpace());
String[] listaDeArchivos = root[i].list();
for(String lista:listaDeArchivos){
System.out.println(lista);
}
}
}
With this i get to list hard disk divitions and the first row of files in them, but i need a cycle that list all of it, all the files within the files.