I have implemented a MessageExchangeListener to integrate my java class with servicemix.
I have to access a property file from this class. The class file say MyListener is in package MyPackage.
I created a folder called MyPropFolder in resources folder and inside MyPropFolder I have MyPropFile.txt
The folder structure of source is as follows
When I create a service assembly and see inside the zip archive created the structure looks as follows:
MyListener.class tries to access the property file as follows:
BufferedReader in = new BufferedReader(new FileReader("./MyPropFolder/MyPropFolder.txt"));
I get the following Exception
java.io.FileNotFoundException: ..\..\MyPropFolder\MyPropFolder.txt (The system cannot find the path specified) ...
I have tried each of the following Paths, however none of them work
Maven Build has also succeeded. When I open assembly.zip, I see appropriate serviceunit .zip in it. And when I open serviceunit.zip I see MyFolder which has MyProp.txt
Infact after deploying, when I have a look at the SERVICEMIX_HOME/data folder I see
What am I doing wrong? How do I read a file with relative URL?