Originally posted by David Harkness:
You shouldn't need to change getDirectoryList's signature.
How about splitting apart your file testing so each method tests one aspect. Currently accept() returns true for directories or htm/html files. The File class has a method that performs the first test already, so simply remove it.
I'd already test it yet, but I observerd that if I do not return True for directory. The listFiles() will filter out all sub-directory. So, I need to add it there.
Did you just add the "isFolder = files[i].isDirectory();" line or did I accidentally delete it when I copying? Either way, simply use this boolean to decide whether or not to put "add the file info to an array of object." No sense adding it and then removing it later if it's a directory when you already know whether or not it's a directory.
You can simplify your structure a bit by rearranging the lines you have. If you change checkFile() as I suggested, you'll need to. Simplify the following logic.