I have this program:
public class TestFileClass {
public static void main(String[] args) {
java.io.File file = new java.io.File("image/us.gif");
System.out.println("Existe " + file.exists() );
System.out.println("tiene un peso de " + file.length() + " bytes");
System.out.println("Puede ser leido? " + file.canRead());
System.out.println("Puede ser escrito? " + file.canWrite());
System.out.println("Es un directorio? " + file.isDirectory());
System.out.println("Es un archivo? " + file.isFile());
System.out.println("Es absoluto? " + file.isAbsolute());
System.out.println("esta oculto? " + file.isHidden());
System.out.println("La ruta absoulta es " +
file.getAbsolutePath());
System.out.println("Fue modificado por ultima vez en: " +
new java.util.Date(file.lastModified()));
}
}
And now what I need is to show from the hidden files how many there are in total. In other words, the program will read the total of files and I want you to tell me the total but only the hidden ones.
I guess I have to go through it, but I do not quite understand where to enter the hidden or how to do it ... I've done it with the total without taking into account the hidden ones:
File miDir = new File (".");
String[] arregloArchivos = miDir.list();
int numArchivos = arregloArchivos.length;
System.out.println("Total de entradas:" +numArchivos);
But I do not know if it is correct at all. And now I need the same thing but the hidden ones.