I have a problem, I guess many hours programming but I do not know how to see, and surely that is the dumbest thing in the world.
I have the following program:
FileFilter directoryFilter = new FileFilter() {
public boolean accept(File file) {
return file.isDirectory();
}
};
File[] files = miDir.listFiles(directoryFilter);
for (File file : files) {
if (file.isDirectory()) {
System.out.print("directorio:");
} else{
System.out.print(" archivo:");
// Mostrar archivos ocultos
int total=0;
File[] archivosYCarpetasInternos = miDir.listFiles();
for (File archivoOCarpeta : archivosYCarpetasInternos) {//si esta oculto..
if (archivoOCarpeta.isHidden()) {
// System.out.println(ficheros[x].getName()); Por si queremos mostrar cuales son...
//Aquí lo que hacemos..
total ++; }
}System.out.println("Número de fitxers ocults :"+total);
}
System.out.println(file.getCanonicalPath());}
What I want to achieve is with the FileFilter to divide my program in two parts by one part directories and by another files.
For now the part of files inside the perfect if it shows me the 4 files there are, but I want to do the same with the else, that shows me the files.
I imagine that the error is there but I do not know how to see it.
thanks!.