Home » Developer & Programmer » JDeveloper, Java & XML » Create Directories Dynamically on Server - Permissions (Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod)
Create Directories Dynamically on Server - Permissions [message #314034] Tue, 15 April 2008 10:48 Go to next message
rasa
Messages: 45
Registered: February 2006
Member
My Java Stored Procedure needs to dynamically create sub-folders on the Oracle Server. I gave the following GRANT:

EXEC DBMS_JAVA.GRANT_PERMISSION('W410', 'SYS:java.io.FilePermission', 
'E:\TMP\ORACLE\DIRECTORIES\ARC\*', 'read,write,delete');


My expectation is that the procedure should be able to create sub-folders underneath "ARC" directory. When I try to create a sub-folder called "myarchive" it blows up with this error:

ORA-29532: Java call terminated by uncaught Java exception: java.security.AccessControlException: the Permission 
(java.io.FilePermission E:\TMP\ORACLE\DIRECTORIES\ARC\myarchive write) has not been granted to W410. 
The PL/SQL to grant this is dbms_java.grant_permission( 'W410', 'SYS:java.io.FilePermission', 
'E:\TMP\ORACLE\DIRECTORIES\ARC\myarchive', 'write' )


What should I do?

[Updated on: Tue, 15 April 2008 10:49]

Report message to a moderator

Re: Create Directories Dynamically on Server - Permissions [message #314037 is a reply to message #314034] Tue, 15 April 2008 11:15 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
What should I do?

Quote:
The PL/SQL to grant this is dbms_java.grant_permission( 'W410', 'SYS:java.io.FilePermission', 'E:\TMP\ORACLE\DIRECTORIES\ARC\myarchive', 'write' )

Regards
Michel
Re: Create Directories Dynamically on Server - Permissions [message #314040 is a reply to message #314037] Tue, 15 April 2008 11:35 Go to previous messageGo to next message
rasa
Messages: 45
Registered: February 2006
Member
Michel:

But, I did give that grant with the wildcard (Please see the "*" after "\ARC").
EXEC DBMS_JAVA.GRANT_PERMISSION('W410', 'SYS:java.io.FilePermission', 
'E:\TMP\ORACLE\DIRECTORIES\ARC\*', 'read,write,delete');
. Is that "*" not supposed to accomplish granting the permissions for all sub-folders below "ARC" directory?

Granting WRITE separately to "myarchive" will not be practical because that sub-directory "myarchive" comes into being only during the execution of the program at run-time. Please help.
Re: Create Directories Dynamically on Server - Permissions [message #314586 is a reply to message #314040] Thu, 17 April 2008 04:03 Go to previous message
shailuwap
Messages: 1
Registered: April 2008
Location: Chennai
Junior Member
rasa wrote on Tue, 15 April 2008 11:35
Michel:

But, I did give that grant with the wildcard (Please see the "*" after "\ARC").
EXEC DBMS_JAVA.GRANT_PERMISSION('W410', 'SYS:java.io.FilePermission', 
'E:\TMP\ORACLE\DIRECTORIES\ARC\*', 'read,write,delete');
. Is that "*" not supposed to accomplish granting the permissions for all sub-folders below "ARC" directory?



You should replace '*' with '-'.
* is to select all files in tat directory
- included subdirs also.

quote from http://download.oracle.com/docs/cd/B19306_01/java.102/b14187/chnine.htm :

Note:
If you are granting FilePermission, then you must provide the physical name of the directory or file, such as /private/oracle. You cannot provide either an environment variable, such as $ORACLE_HOME, or a symbolic link. To denote all files within a directory, provide the * symbol, as follows:

/private/oracle/*

To denote all directories and files within a directory, provide the - symbol, as follows:

/private/oracle/-



Hope this helps!


Previous Topic: Loading XML documents into relational tables
Next Topic: BIP Extension
Goto Forum:
  


Current Time: Fri Apr 19 09:53:05 CDT 2024