使用java编程进行版本控制

发布于 2024-12-17 16:04:34 字数 156 浏览 0 评论 0原文

在我的Java项目中,我需要向文件添加版本控制(如SVN),为同一文件夹中的同名文件维护不同版本。请帮助我如何在java编程中做到这一点。 例如:在我的项目中,我维护了一个文件夹,其中包含用户上传的一组图像。但是用户可以多次上传相同的命名图像。为了克服这种开销,我计划对每个相同的图像(相同命名)。

In my Java project I need to add versioning control to the files(Like SVN), maintain different versions to the same named files in same folder. Please help me how to do this in java programming.
Eg: in my project,i maintained a folder which have set of images which are uploaded by user.but user can upload same named image n number of times.to overcome this overhead i planned to maintain versioning to each image which are same (same named).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

青朷 2024-12-24 16:04:34

源代码控制代码不是执行此操作的方法。文件上传时将其重命名为 uuid,并构建原始文件名 -> uuid 文件名和时间戳的映射,然后您可以根据需要查找或过期。

Source control code is not the way to do this. Rename the files to a uuid as they get uploaded and build a map of original filename->uuid filename with timestamps that you can then lookup or expire as needed.

め可乐爱微笑 2024-12-24 16:04:34

我同意awm的观点。版本控制不适用于二进制文件。但是,如果您坚持这样做,SVN 有一个 API 可供您使用。您可以直接从代码访问它以提交代码、更新代码等。

这是一个起点:http://svnkit.com /

去查看“Subversion 客户端和 IDE 集成”下的 SVNClientManager
Subversion 客户端和 IDE 集成”

看起来不错。

(当然,我已经很久没有使用 SVN 了……我从一个更好的工具中“得到”了喜悦……:-))

I agree with awm. Version control is not for binary files. However, if you insist to do it like that, SVN has an API that you can use. You can access it directly from your code to commit code, update code, etc.

Here's a place to start: http://svnkit.com/

Go checkout out the SVNClientManager under "Subversion Client and IDE Integrations
Subversion clients and IDE integrations"

Good look.

(of course, I haven't used SVN in ages... I 'git' joy from a much better tool... :-))

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文