• Post Reply Bookmark Topic Watch Topic
  • New Topic

overwrite the property file  RSS feed

 
Karuna Kethineedi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:

I have jar file within the application and it contains a property file.
I need to retrieve that property file from the jar and overwrite a particular property from the application.

Is this possible? if so how do i do this?

Ex. my xyz.jar has config.properties with a logfile = /xyz/abc/util.log

I need to retrieve this property from my application and change the value for this logfile.

Thanks in advance.
Karuna
 
Paul Clapham
Sheriff
Posts: 22708
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. It isn't possible to update entries in a jar file.
 
Karuna Kethineedi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the code in jar file is writing logs to a particular path.
i have to change the path to which it is writing from the application.
I cant change the jar file.
there is no way that i can achieve this.
pls suggest.

thanks in advance
Karuna
 
parth jeevan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I do believe you can edit the jar file.
Look at this resource i just checked on google
http://home.att.net/~cherokee67/jarfile.html

parth
 
Karuna Kethineedi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeevan,

I know i can edit the jar file.
But i dont want to.
My question is "Without editing or changing the code of the jar file can I overwrite the config file of the jar? "

Thanks though.
I aprreciate your help.

Karuna.
 
parth jeevan
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karuna

Without editing or changing the code of the jar file

I am assuming that you thought that editing the jar will mean you'r editing your code.
Well if you have the jar then why dont you just open up the jar with a program like "WINZIP" and then just edit the config.properties file which im sure is a text file.You wont be editing the code anyways.
If ive misunderstood your question im sorry :-)
Bye
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!