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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.