i'm using Eclipse 4.2.0 and I need to list all the filenames from a folder imported in a project. that folder is "account_info" and is right under the project home folder.
the method i'm using is
List<String> account_files = new ArrayList<String>();
File[] files = new File("account_info").listFiles();
for (File file : files) {
if (file.isFile()) {
account_files.add(file.getName());
}
}
for(int i = 0; i < account_files.size(); i++){
System.out.println(account_files.get(i));
}
but... no luck! i also tried referring to that folder using the path "../account_info".
thanks, in advance, for any help.