• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java API to read a file diff from CVS repository

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In my current requirement i have a legacy txt file that contains lots of data , each record per row. The file is checked in at a cvs repository
A legacy system keeps on updating it (adding/deleting) from time to time.

I am writing a code that creates a replica of this legacy txt file in Oracle database.
So i need to write a code in java that creates a sync between my table and the legacy txt file.
My initial thought is to get hold of a cvs api that reads a diff of this legacy file in repository to a local copy and identified which records are added/modified/deleted from the file.
Based on that i will update my database. This will be a time triggered process.

Any thoughts or suggestions? Any standard java api i can use?
 
Saloon Keeper
Posts: 28392
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you'll find a "cvs api" to get file diffs. The CVS client program uses the "diff" program in accordance with the ancient and honorable Unix tradition that it's better to glue together simple specialized programs than to write one monster do-all program.

Eclipse's built-in comparision utility on the other hand, I'm not so sure about. Since Eclipse is portable, I would expect that someone probably found (or created) a version of diff written in Java.

Since Eclipse is open-source, I'd recommend looking through the Team/CVS source code and documentation. Your best bet is probably to find the interfaces that it uses and create a small plug-in that will run the internal diff process according to your specific needs.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic