BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   Get XML InputStream from .cod file (http://www.blackberryforums.com/showthread.php?t=2976)

phobeous 02-04-2005 06:52 AM

Get XML InputStream from .cod file
 
Hi everyone, I'm developing an application in which I've to read a xml file (it describes a tree-menu). For that issue I just added the xml file to the project and parsed it with Kxml, using .getResourceAsStream(...) inside my custom parser method. Everything works fine if I use no packages (usually when I'm testing). When I decided to use packages, I moved the xml file to the same directory as my parser class and the file just can't be read.

This has sense because the intermediate .jar file doesn't associate the path to resources files (such as images and my xml file).

The first solution is go backward and refuse packages but I want to use packages, so the answer is: does anyone got the same problem as me? If so: how did you solve?. Maybe this could be done with access to the contents of the cod file. Is this last possible?

Thanks in advance for any feedback.

Greetz from Spain!!

P.S.: Sorry for my English.

phobeous 02-04-2005 07:51 AM

Auto-answer
 
Just added the full-qualified name of the class:

Code:

parser.setInputxxx40;new InputStreamReaderxxx40;Class.forNamexxx40;"com.company.ClassName"xxx41;.getResourceAsStreamxxx40;"/file.xml"xxx41;xxx41;xxx41;;
Really works.


All times are GMT -5. The time now is 09:57 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.