java - get all absolute paths of files under a given folder -
i need hold in memory absolute paths of file names under given directory.
mydirectory.list() - retrieves string[] of file names (without absolute paths).
don't want use file object since consumes more memory.
last thing - can use apache collections etc. (but didn't find useful that).
string directory = <your_directory>; file[] files = new file(directory).listfiles(); for(file file : files){ if(file.isfile()){ system.out.println(file.getabsolutepath()); } }
this works, , gotta i'm confused when don't wanna use file objects, whatever works, guess.
Comments
Post a Comment