Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java File Permission <<ALL FILES>> 1

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi,

I have a java stored procedure that performs directory operations (create, delete, rename) and I want to grant access to all files under a specific directory to the user, so he can create whatever file or directory in that specified directory. Is there a way to do this?

I know
Code:
call dbms_java.grant_permission('USER_NAME','SYS:java.io.FilePermission','<<ALL FILES>>','read,write,delete');
grants access to all files, but can I do something like
Code:
call dbms_java.grant_permission('USER_NAME','SYS:java.io.FilePermission','D:\mydir\<<ALL FILES>>','read,write,delete');

Thanks for the help
 
Hi,
A pathname that ends in "/*" (where "/" is the file separator character,File.separatorChar) indicates a directory and all the files contained in that directory.

A pathname that ends with "/-" indicates a directory and (recursively) all files and subdirectories contained in that directory. The special pathname "<ALL FILES>" matches all files.

For example:
SQL> exec dbms_java.grant_permission('XYZ',
'java.io.FilePermission',
'D:\oracle\ora810\-',
'read') ;

above directorystructure applies to MS Windows,

For unix it
can be for example: '/u01/app/oracle/product/8.1.7/-'

The usage of the "\-" or "/-" assures recursive access to all files and subdirectory in the mentioned directory.

HTH
Regards
Himanshu
 
Thanks! That works perfectly!

Do you know if I can reference a folder or file through the network name?

SQL> exec dbms_java.grant_permission('XYZ',
'java.io.FilePermission',
'//10.54.50.95/webfiles/-',
'read') ;

Would this work? Or should I just map //10.54.50.95/webfiles as t:\ and grant the permission to t:\- ?

Thanks again!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top