Tracking/logging changes made to property file

Discussion in 'Java' started by Sumukh, Mar 8, 2005.

  1. Sumukh

    Sumukh Guest

    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
    Sumukh, Mar 8, 2005
    #1
    1. Advertising

  2. Sumukh

    Ulf_N Guest

    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
    Ulf_N, Mar 8, 2005
    #2
    1. Advertising

  3. Sumukh

    Steve Bosman Guest

    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.
    Steve Bosman, Mar 8, 2005
    #3
  4. Sumukh

    Sumukh Guest

    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
    Sumukh, Mar 8, 2005
    #4
  5. Sumukh

    Ulf_N Guest

    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
    Ulf_N, Mar 8, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. R3n H03k
    Replies:
    0
    Views:
    273
    R3n H03k
    Nov 21, 2003
  2. R3n H03k
    Replies:
    0
    Views:
    317
    R3n H03k
    Nov 21, 2003
  3. Tony Middleton

    Datagrid losing changes made in ItemDataBound

    Tony Middleton, Apr 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    300
    Tony Middleton
    Apr 22, 2004
  4. John Salerno
    Replies:
    9
    Views:
    264
    Neil Cerutti
    Nov 15, 2006
  5. J. Romano
    Replies:
    6
    Views:
    91
    Bob Walton
    Sep 4, 2004
Loading...

Share This Page