In a program I am writing, I am wanting to look at the contents of the current directory (that is, the directory in which my .class files reside) and get, for example, a list of all the image files in the directory. I am trying to achieve this via the java.io.File class (particularly the list() method of the class).
The problem I am having is this, though: an exception is being thrown because I don’t have the proper permissions (i.e. read access) for this particular directory. Now, I can understand how this can be possible… but according to the Java Documentation (look under the entry for FilePermission) the application/applet has read access to all files in the same directory as the .class file, by default.
So… is the documentation incorrect with this “assumption”, or am I just completely missing something? (I figured I would try to find answers here, before I write a java policy file or something).
Much thanks to anyone who can offer any ideas.