aspose file tools*
The moose likes Java in General and the fly likes Any java code for to commit the file/s dynamically in a folder? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Any java code for to commit the file/s dynamically in a folder?" Watch "Any java code for to commit the file/s dynamically in a folder?" New topic
Author

Any java code for to commit the file/s dynamically in a folder?

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
As we do in version control systems, Can we do with java code to commit/checkin all files in a folder? If anyone have any idea please have share with me. I really appreciated your help.


Thanks,
Kumar
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11476
    
  16

you want to write java code that will commit all the files in a given directory to your version control system?

Doesn't your version control system allow wildcards?


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi fred, please look into the following quotes

fred rosenberger wrote:you want to write java code that will commit all the files in a given directory to your version control system?

YES, Could you please give me any solution

fred rosenberger wrote:
Doesn't your version control system allow wildcards?


Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.

Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18982
    
  40

Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.


This doesn't make sense. CVS allows you to "check out" projects to your local machines. You can then make changes to those files, and submit the changes. There is no need to copy to a CVS location before you can submit.

And there is no need to commit with java code, you can either use the CVS command line interface -- or better yet, with most IDEs, you can have the IDE checkout, and submit the changes back for you.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Most systems allow copying/moving via wildcards as well anyway...

It's not really clear what problem you're trying to solve--and it's almost *certainly* not best solved with Java.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3018
    
  10
The phrase "our current CVS" sounds odd here. Are you using CVS, which is a specific type of version control system (VCS)? Or are you using something else?

Kumar Kuchipudi wrote:Actually we got some problems with our current CVS, in order to check in the code we need to first copy the all files to CVS location and commit with java code.

According to whom? Has someone already solved this problem using Java code? Is there a boss somewhere saying "you must use Java" just because they've heard good things about Java?

The thing is, if you use Java code, you'll probably just have to do a Runtime.exec() or something similar, to execute a command to do the commit in a shell. Much like you would have done from the command line, or a script. But it will be harder because using exec() in Java has a bunch of hidden issues. You can do it, but in this case, why?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(Well, there's at least two Java SVN libraries, but it still doesn't seem like a good idea in this case.)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18982
    
  40

David Newton wrote:(Well, there's at least two Java SVN libraries, but it still doesn't seem like a good idea in this case.)


Agreed -- it doesn't seem like a good idea... but if you are going to do it, make sure you get a CVS library -- as CVS and SVN are two different source code control systems.

Henry
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Oh, right. *lol* I'm so over CVS don't even see it when it's right in front of me ;)

Wow, I'm really terrible sometimes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any java code for to commit the file/s dynamically in a folder?