• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

overwrite the property file

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 27371
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Everybody! Do the Funky Monkey! Like this tiny ad!
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic