Jump to content

How to refer the path of a file Stored in a folder e.g the file is stored in BEProject/SharedResources/StaticData folder. It is accessed from TIbcoBEProject/RuleFunctions/Admin/XXRulefunction


Recommended Posts

The file is read from a rule function. The file is stored inside one of the folders in tibcoBE project.I can not give the complete path as after the deployment there is no fixed name for one of the folders as it keeps changing whenever the instance is created. So decided to store in one of the tibco BE project folders (similar to schema file). But having problem in accessing it. Tried by referring ./SharedResources/StaticData. But the file is not picked up. Can someone help in this.
Link to comment
Share on other sites

  • 9 months later...

Set the working directory to the location of the project. Now you can create a custom function that returns the current working directory and read the file from here.

eg:

String sPath=GetCurrPath.getCurrPath();

String sContent = File.readFileAsString(sPath+"/SharedResources/testInput.txt");

System.debugOut("### File contents is: " + sContent);

Attached a sample project.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...