SVNKit - 检查目录是否存在
因此,我在 SVN 存储库下创建了一个项目 TEST,我想知道该项目目录是否与 SVNKit 库一起存在。协议是http。
例如,我尝试过...
private String urlSviluppo = "http://myrepo/SVILUPPO";
DAVRepositoryFactory.setup();
SVNURL url = SVNURL.parseURIDecoded(urlSviluppo);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager("user", "pwd");
DAVRepository repositorySviluppo = (DAVRepository)DAVRepositoryFactory.create(url, null);
repositorySviluppo.setAuthenticationManager(authManager);
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager clientManager = SVNClientManager.newInstance(options, "user", "pwd");
clientManager.createRepository(url, true);
如何访问存储库/项目信息?
谢谢
So, I've created a project TEST under an SVN repository and I want to know if this project directory exists with SVNKit library. Protocol is http.
I tried for example...
private String urlSviluppo = "http://myrepo/SVILUPPO";
DAVRepositoryFactory.setup();
SVNURL url = SVNURL.parseURIDecoded(urlSviluppo);
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager("user", "pwd");
DAVRepository repositorySviluppo = (DAVRepository)DAVRepositoryFactory.create(url, null);
repositorySviluppo.setAuthenticationManager(authManager);
DefaultSVNOptions options = SVNWCUtil.createDefaultOptions(true);
SVNClientManager clientManager = SVNClientManager.newInstance(options, "user", "pwd");
clientManager.createRepository(url, true);
how can I access repository/project info ?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看“打印 Subversion 存储库树” 中的示例。它包含以下代码:
检查您的位置是否可以作为存储库根。
迭代当前目录的条目。
对子目录递归调用它(如果你想访问)。这应该为您提供足够的材料来完成整个功能。
Have a look at the example at "Printing Out a Subversion Repository Tree". It contains the following code:
That checks if your location is ok as a repository root.
Iterate over the entries of the current dir.
Call it recursively for sub-dirs (if you want to visit). This should give you enough material to do the whole function.