aspose file tools*
The moose likes Java in General and the fly likes How to Change these Folder Security Permission? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to Change these Folder Security Permission?" Watch "How to Change these Folder Security Permission?" New topic
Author

How to Change these Folder Security Permission?

J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
Greetings everyone!!
Since I'm doing Swing-ing in this Windows Environment.
I didn't realize that the Permission issues are important also.

Geeezzz... Take a look at this image;



Uploaded with ImageShack.us

Is there anyway we do changing these permission values through JAVA?
Because I realized it can't be done changing in Registry, it's not the place to do that. Heheheh.

Any clue?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

You'll need to use JNI. Perhaps someone has already done this and has written a public library. Use "ACL" in your search.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Vishwanathan Nagarajan
Ranch Hand

Joined: Jan 28, 2009
Posts: 37
Rob,


Please go through the following link,

http://download.oracle.com/javase/1.4.2/docs/guide/security/permissions.html


Cheers.


MCP, SCJP 1.4, SCWCD 1.4, SCBCD 5.0, SCDJWS 1.4
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

Vishwanathan Nagarajan wrote:
Please go through the following link,

http://download.oracle.com/javase/1.4.2/docs/guide/security/permissions.html


I don't see the relevance! That link is concerned with permissions from the point of view of Java security but the OP wants to change permissions of files on the underlying file system. OK, both are concerted with security but your reference is adding additional access constraints over and above those imposed by the underlying file system. For example, you might set up a Java security permission to edit the /etc/passwrd file but unless you are running as root (or some idiot has changed the underlying permissions of the file /etc/passwrd) you won't even be able to read it.


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
GEEEZZZ...

is that means we (from java) doesnt have the API for it?
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

J. Insi wrote:GEEEZZZ...

is that means we (from java) doesnt have the API for it?


Java 7 will allow better control over file permissions but even then you will need to be the right sort of user to set some file/directory permissions. No language should allow one to bypass the security constraints imposed by the OS but I do feel that the current ridiculous minimal approach was badly thought out in the first place and has existed for far too long.
J. Insi
Ranch Hand

Joined: Aug 11, 2010
Posts: 90
the strange case encountered is that
i am as the administrator in this laptop. (so I do have the right, didn't I ?)

And, I dunno why.

My installer created by Advanced Installer to bundle my java apps (developed by me) is fine.
Until its done the installation (copying the files, etc).

So thus, the directory and its file already copied there... but
at the time I run the java app I installed there.... well, the permission issues comes.

Very strange.
Dat's why I'm asking this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Change these Folder Security Permission?