2

I am using SVNKit to access VisualSVN Server from my java code.

My application is a Dynamic web application. I am using Struts2.

I am done with the connection & authentication part from my java code.

I want to upload a file into the repository directly.

Is it possible to directly upload a file into the repository from java code?If yes, then how should I proceed and what approach should I follow?

Please help me out I am in need..

2
  • 2
    u have to check the svnkit api Commented Aug 21, 2012 at 10:15
  • I checked with the SVNKIT only list of interfaces is there but I am not able to get how to use all that into my java code. Commented Aug 21, 2012 at 10:58

2 Answers 2

2

Well. the svn(or any other source control for that matter) is designed for a programming atmosphere where multiple programmers (or just one) are working on a project and same files are being edited by multiple people. so a source control is used to track changes of code and by whom. So you gotta ask yourself 1- is there a semantic relations between my reports so that I need to track the changes between them? 2- do I care who made that change? if the answer to both questions is a no then svn is just an overkill and adds an unnecessary level of complexity.

Another thing, are these reports in a binary file format? if yes then this is one more disadvantage of using svn, since it can't keep track of what has changed. it will just commit the whole file as it is. If the file is ascii (text) format, then do you need to track changes? if yes, then svn can do it, but also a bunch of other tools can do it without the complexity of depending on svnkit library.

If you just need to store different reports with different "upload time" why dont you just use a database, with the following fields: (id, report, timestamp, some foreign key).

Hope this helps

Sign up to request clarification or add additional context in comments.

3 Comments

thanks for your support and replying to me with a detailed answer. But unfortunately my user wants to use SVN for this.I can send you the complete code to you if you can find out some time for me and help me..I have created all the java classes. But facing problem when I am trying to give some other path.Like for the report I want to upload.As of now I have made all my methods in main method. Please reply me with your email so that we can have conversation and reach a solution.I will be very thankful to you.. Thanks in advance..
Hello. unfortunately this is not how a help forum works. you won|t find someone to give your whole code so that he debugs/implements it for you for free. do what you can and if you have concrete questions then ask them here. read this article mattgemmell.com/2008/12/08/what-have-you-tried
one more thing, maybe the user wants svn, but its part of your job as a programmer to convince him that this is not the right choice(if really its not),its part of your job to defend what you believe is right and logical,and not just try to do whatever the user tells u. my advice is, read more about your options and decide what is the right thing to do, then start convincing the client with it
0

Check the SVNKit API reference.

Through SVNClientManager class you get access to a number of interfaces that allow you to perform virtually everything that a Subversion user may need.

4 Comments

sir I have used the same for authentication and connection but not able to get get how should I use it for uploading the file and then 'COMMIT' & 'CHECKIN' & 'CHECKOUT'. If you can guide me I will be very thankful to you..
I don't believe that there's a concept called "upload" in svn. its called simply checkin or commit
@Moataz Elmasry: ok sir.. I'll tell you my complete scenario
@Moataz Elmasry : i.e what I want to do?, why I am using SVN? In my application I have a feature called upload reports. This report is regarding the product details. and several reports will be entered with every time no. of new products in report. So I thought of using SVN to maintain the versions of REPORTS.So,I simply want that every time when I upload it should go to repository and saved with a version.Kindly guide me with approach to be followed.I will be very thankful to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.