• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX (UrlyBird):Accessing the config.txt file inside the runme.jar

 
felix kerner
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I have to have my config.txt file inside my runme.jar archive
(according to the packaging instructions). I tied everything in
terms of relative addressing, but my programm only works when i
leave the config.txt file in the working directory.
How can I tell my programm to look for the file inside the jar?
i tried this but it doesn't work:

RandomAccessFile r = new RandomAccessFile("/config.txt", "r");

Can anybody help me?
Thank you,
Felix
 
Dushy Inguva
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Felix,
You can ask the classloader to load the resource ...

Pretty convoluted !!! :roll:
Dushy
 
Bharat Ruparel
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Felix,
I also have URLyBird, where does it mention config.txt? My instructions don't mention it at all?
Regards.
Bharat
p.s. do you mean Suncertify.properties by any chance?
 
felix kerner
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I went for a wrong solution to create my own text file to store
the the system's configuration. Thank you Barath for pointing out
that we have to use the properties class to do that.
And also thanks to Dushy for the classloader code anyway :-).
Best of luck for certification,
Felix
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic