KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to be able to list the files in the current directory. I've made something that should work but doesn't return all the file names. File dir = new File("."); File[] filesList = dir.listFiles(); for (File file : filesList) { if (file.isFile()) { System.out.println(file.getName()); } } It returns .classpath , but I'm quite sure I have other java files inside this folder. Maybe the dot notation for current folder is incorrect?
Tags (comma-separated)
Save Edits
Cancel