Your issue is you are trying to grant permissions on a specific directory. That is fine if you just want to read and write files in that directory, but you will not be allowed to create a new subdirectory. Why? Because you don't have permission on that subdirectory. To do that you would first have to grant the JVM permission to do access the new subdirectory, then create it.
For example:
- Code: Select all
dbms_java.grant_permission(<Schema_name>,'SYS:java.io.FilePermission','/home/oracle/TestDir1/test1','read,write,execute,delete');
dbms_java.grant_permission(<Schema_name>,'SYS:java.io.FilePermission','/home/oracle/TestDir1/test2','read,write,execute,delete');
dbms_java.grant_permission(<Schema_name>,'SYS:java.io.FilePermission','/home/oracle/TestDir1/test2/test3','read,write,execute,delete');
Then create them...
That's why I asked if you had tried this and asked if it had worked.
- Code: Select all
EXEC DBMS_JAVA.grant_permission('SCHEMA-NAME', 'java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
Unfortunately, you never bothered to tell me the answer, thus delaying the resolution to your issue!
So, if you want to grant for specific directories, you will also need to grant for any potential subdirectories you want to create in advance of creating them, which is crappy.
Cheers
Tim...