For a program I have been working on, I have been creating some functions that searches for files. For the purpose of the applet, all the files that are being searched for are within the same folder of the java applet is being ran. What I have been doing is using a URLConnection. However, this requires the exact name of the file and I wanted to add more functionality to it.

I have been experimenting with the File Class to try and print out a list of all the files contained within the folder the applet is running from.
     url = getCodeBase();
     try {
           uri = new URI(url.toString());
     } catch (URISyntaxException e) {
           // for no particular reason
     f = new File(uri);
However, I haven't had much success. I can drawString with the f.getName, etc. However, I cannot use the f.list() command to print out everything in the directory, or use some of the other functions associated with the File class.

Should I be looking at another class to use instead of the File class within my applet? Thanks.

[ArchAngel added CODE tags]