Get a list of files and folders in a directory with Java
Before Java 8, you can use the listFiles() method of the File class with the parameter of the directory that we want to get the list of files and directories to do this. Eg:
1 |
File[] files = new File("/Users/khanh/Documents/code/huongdanjava.com").listFiles(); |
The return result will be a list of File objects… Read More