No, Megs' post tells how to do this from the command line, not from Java. If you look at the API for File, you will find there's no way to use list() with a String argument. (The fact that the code does not compile would be another clue.)
"I'm not back." - Bill Harding, Twister
Quick! Before anybody notices! Cover it up with this tiny ad:
a bit of art, as a gift, the permaculture playing cards