Frank Lümkemann wrote:
>
> I want to access image files contained in a directory, and I would
> like to scan the whole directory. When I use the appletviewer, the
> following code gives me a list of the files in the dir, but not with
> Netscape. I think the security manager throws an exception, but how
> can I access a directory from an applet then?
You can use the Netscape Capabilities classes to ask the user for
permission.
Details at
http://developer.netscape.com:80/docs/manuals/signedobj/capabilities/contents.htm
.
Nathan
>
> thank's for your help!
>
> Frank
>
> private void scan_directory() {
>
> dialog = new SimpleFileDialog(this, "Select a file!");
> dialog.show();
> PrintWriter out = new PrintWriter(System.out, true);
>
> try {
>
> File dir = new File(dialog.getDirectory());
> String str = new String(dialog.getFile());
> char c = str.charAt(0);
>
> setText("Directory: " + dialog.getDirectory());
>
> for (int i = 0; i < dir.list().length; i ++) {
> setText("File " + i +": " + dir.list()[i]);
> }
> } catch (Exception ev) {
> FileButton.window.dispose();
> out.println("keine datei geladen...(EXC)!");
>
> }
> }
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a
> subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]