Thanks for your reply, but how do we set file permission dynamically from java program.
for instance we have below direcotry structure and want to give write access to place or edit files under LEVEL 2 DIRECTORIES , how can we do that ? I also donot want him to navigate uppel level directories. How do we set permissions from java ?
LEVEL 1 DIR LEVEL 2 DIR LEVEL 2 DIR FILE1 FILE2 FILE3 LEVEL 2 DIR
You have access to file permissions with the java.io.FilePermissions class.
However, think about what you are trying to do here: you have a program running on a user's machine, presumably as that user? And you want to selectively restrict access to their own file system? OK you can do it, but its trivial to subvert. Why don't you want to allow users to navigate to certain places in their own file system?
However in this particular case it is a file share and there are other directories which cannot be shared to user, so each one should be restricted to just creating a directory and copying there files into that directory (level2).
Is there any sample code to set file permission using FilePermission ?