Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tracking/logging changes made to property file

Reply
Thread Tools

Tracking/logging changes made to property file

 
 
Sumukh
Guest
Posts: n/a
 
      03-08-2005
Hi all,
We have written swing based application to edit property files(plain
text) of our application. We want to keep track of changes made to this
property file.
For e.g. if someone changes some property value from the file, then old
value of the property should be logged somewhere.

I m not sure about how to check which property was changed and then how
to store its old value.

One way is to create backup of the property file and then compare backup
and original while saving the file. But I couldn't find any API to
compare the files using java.

Please suggest what can be done to achieve this ?

Thanks in anticipation

Sumukh
 
Reply With Quote
 
 
 
 
Ulf_N
Guest
Posts: n/a
 
      03-08-2005
Sumukh skrev:
> Hi all,
> We have written swing based application to edit property files(plain
> text) of our application. We want to keep track of changes made to this
> property file.
> For e.g. if someone changes some property value from the file, then old
> value of the property should be logged somewhere.
>
> I m not sure about how to check which property was changed and then how
> to store its old value.
>
> One way is to create backup of the property file and then compare backup
> and original while saving the file. But I couldn't find any API to
> compare the files using java.
>
> Please suggest what can be done to achieve this ?
>
> Thanks in anticipation
>
> Sumukh


Couldn't you use cvs? (https://www.cvshome.org/)
/ulf
 
Reply With Quote
 
 
 
 
Steve Bosman
Guest
Posts: n/a
 
      03-08-2005
Sumukh wrote:
> Hi all,
> We have written swing based application to edit property files(plain
> text) of our application. We want to keep track of changes made to

this
> property file.
> For e.g. if someone changes some property value from the file, then

old
> value of the property should be logged somewhere.
>
> I m not sure about how to check which property was changed and then

how
> to store its old value.
>
> One way is to create backup of the property file and then compare

backup
> and original while saving the file. But I couldn't find any API to
> compare the files using java.
>
> Please suggest what can be done to achieve this ?


You could use jLibDiff http://jlibdiff.sourceforge.net/ which will
compare two files.

If you are talking about standard java properties files storing key
value pairs, and you don't really care about sequence order changes, a
hash map based solution would probably work as well. Load original into
a map and cycle through the modified properties file comparing values,
for very large files this is inefficient but on a stand alone app on a
modern PC you can probably get away with it.

 
Reply With Quote
 
Sumukh
Guest
Posts: n/a
 
      03-08-2005
Hi ,
Thanks for the reply.
CVS is usually used while developing the software.
Here I have fully developed,running application.
I just want to keep track of changes, made to property file.

Thanks

Sumukh

Ulf_N wrote:
> Sumukh skrev:
>
>> Hi all,
>> We have written swing based application to edit property files(plain
>> text) of our application. We want to keep track of changes made to
>> this property file.
>> For e.g. if someone changes some property value from the file, then
>> old value of the property should be logged somewhere.
>>
>> I m not sure about how to check which property was changed and then
>> how to store its old value.
>>
>> One way is to create backup of the property file and then compare
>> backup and original while saving the file. But I couldn't find any API
>> to compare the files using java.
>>
>> Please suggest what can be done to achieve this ?
>>
>> Thanks in anticipation
>>
>> Sumukh

>
>
> Couldn't you use cvs? (https://www.cvshome.org/)
> /ulf

 
Reply With Quote
 
Ulf_N
Guest
Posts: n/a
 
      03-08-2005
Sumukh skrev:
> Hi ,
> Thanks for the reply.
> CVS is usually used while developing the software.
> Here I have fully developed,running application.
> I just want to keep track of changes, made to property file.
>
> Thanks
>
> Sumukh
>


There should be some interfaces available. (Don't netbeans have a Java
interface?) Maybe overkill in your case though..
/ulf
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rebel XT, made in Japan, made in Thailand jazu Digital Photography 10 12-12-2006 05:11 AM
What easy technique shall i use in developing a java program that will output to screen or to a file changes/updates made inside a specific directory ...? bronby Java 6 04-22-2005 12:05 PM
How do you lock a file BEFORE changes are made? J. Romano Perl Misc 6 09-04-2004 12:47 AM
What changes are made in webservice properties R3n H03k ASP .Net 0 11-21-2003 04:08 PM
What changes are made in webservice properties R3n H03k ASP .Net 0 11-21-2003 04:01 PM



Advertisments