So I have an Axis2 webservice deployed to apache tomcat 6.0.29. Its a getDocument service which uses MTOM to transfer files to the client from the server through the service. So what I want to do is when a client requests a specific file by its attributes[names, tags, author, etc.] I will pick up a file from my filesystem and tranfer as SOAP attachment via MTOM to the client.
My question is, How do I specify relative paths to the content directory[the directory where my files are stored] after the service is deployed?
Right now when i do:
File f = new File("test");
System.out.println(f.getAbsolutePath());
It gives me C:\apache-tomcat\bin\test
I understand that this is because my service runs in a sandbox. But how do get around this issue and specify something relative to my service:
For eg. My service is deployed in tomcat/web-apps/axis2/services as Document.aar. So can I specify something inside Document.aar and then give a path like /contentRoot/test.xml
?
Please help me out!