java how to list an entire dir code example Example: java get folder content File file = new File("Path to file"); File[] files = file.listFiles();