BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-04-2005, 06:52 AM   #1
phobeous
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: Spain
Model: 7230
Carrier: Movistar
Posts: 19
Default Get XML InputStream from .cod file

Please Login to Remove!

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.
Offline  
Old 02-04-2005, 07:51 AM   #2
phobeous
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: Spain
Model: 7230
Carrier: Movistar
Posts: 19
Default 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.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White picture

Vintage Apple Computer 4” Paper Cube Notepad Macintosh 80s 90s Office White

$39.95



Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod picture

Lot of 6 Vintage Apple Drawstring Bags For iPhone, Mac, Apple Watch, iPod

$45.00



Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel picture

Retro 1951 Apple Computer Logo 0.7mm Ballpoint Black Ink Pen Gold Barrel

$56.41



VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED picture

VINTAGE 1994 Apple Black Toner Laser Writer Cartridge M 2473 G/A NEW SEALED

$25.95



Vintage Red Apple Six Drawer Storage Organizer File Cabinet  picture

Vintage Red Apple Six Drawer Storage Organizer File Cabinet

$35.00



Vintage  Rainbow Logo Apple Post-It Sticky Notes 4

Vintage Rainbow Logo Apple Post-It Sticky Notes 4" Rare computer collectible

$39.99







Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.