Tuesday, February 4, 2014

How to change the file permissions programmetically in OAF

Changing file permissions programmetically


This is one of the rare situation we face in OAF. Consider that suppose you are moving the file from local machine to server through OAF using message file upload item. Now you need that while moving you want to change the file permissions.

To achive this write the below code after the file uploading code.

Set the file permission :
  1. file.setExecutable(boolean); – true, allow execute operations; false to disallow it.
  2. file.setReadable(boolean); – true, allow read operations; false to disallow it.
  3. file.setWritable(boolean); – true, allow write operations; false to disallow it.

If you not find these methods in your jDeveloper then use the below line of code.

Runtime.getRuntime().exec("chmod 777 /sw_stage/utldata/csdupdate/incoming/"+uFileName);


No comments:

Post a Comment