on 07-18-2007 9:35 AM
Hello,
I got a XML file with some data which I need for my application. I put the file in the folder: src/mime/components/com.sap.test/mydata.xml
I also tried src/packages/com/sap/test/mydata.xml
How can I access this file?
e.g. I tried
InputStream is = getClass().getClassLoader().getResourceAsStream("mydata.xml");
Thanks
Rene
HI Rene,
Let the xml file be mydata.xml inside src/mime/components/com.sap.test/
To access to this file,
String url=WDURLGenerator.getResourcePath(wdComponentAPI.getComponent().getDeployableObjectPart(),"mydata.xml");
File f=new File(url);
try
{
FileInputStream fos=new FileInputStream(url);
}
catch (Exception e)
{
wdComponentAPI.getMessageManager().reportException("While reading file "+e,true);
}
Regards,
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.