String directory = <your_directory>; File[] files = new File(directory).listFiles(); for(File file : files){ if(file.isFile()){ System.out.println(file.getAbsolutePath()); } }
This works, and I have to say that I'm confused when you say that you do not want to use File objects, but everything that works, I think.
source share