🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.swing
1 messages
1 total messages Started by Sven Goetgeluck Wed, 18 Feb 2004 12:54
filepermission
#1214
Author: Sven Goetgeluck
Date: Wed, 18 Feb 2004 12:54
25 lines
1529 bytes
Hi,
I want to check wether i can write in a directory
using following codesnippet

try {
         String curDir = System.getProperty("user.dir");

        AccessController.checkPermission(new FilePermission("C:\\tempie\\-",
"read"));
        System.out.println("Writing and reading permission on :"+ curDir);



        // Has permission
    } catch (SecurityException e) {
      String curDir = System.getProperty("user.dir");
       System.out.println("No writing or reading permissions on "+ curDir);
        // Does not have permission
    }


But allways throws the exception what can be wrong?
even if i use the curDir string it goes wrong

Sven
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads