svnkit:获取条目名称时出现问题
我正在尝试创建 SVN Eclipese EFS 插件,但在获取条目名称时遇到问题。
当我拨打电话时: SVNRepository
`//将目录的内容提取到提供的集合对象中并返回目录条目本身。
SVNDirEntry getDir(String path, long revision, boolean includeCommitMessages, Collection Entry)`
它正确返回所提供路径的条目,但是,它不会在“返回”条目上设置“名称”值。注意,集合中返回的项目都是OK的。
有谁知道这是为什么?和/或是否有解决方法?
看: http://svnkit.com/javadoc/org/tmatesoft/ svn/core/io/SVNRepository.html http://svnkit. com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html#getDir(java.lang.String, long, boolean, java.util.Collection)
I'm trying to create a SVN Eclipese EFS plugin and have problems when getting the names of entries.
When I make a call to:
SVNRepository
`//Fetches the contents of a directory into the provided collection object and returns the directory entry itself.
SVNDirEntry getDir(String path, long revision, boolean includeCommitMessages, Collection entries)`
It correctly returns the entry for the provided path, however, it doesn't set the "name" value on the "returned" entry. Note, the items returned in the collection are all OK.
Does anyone know why this is? And/or if there is a workaround?
See:
http://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html
http://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html#getDir(java.lang.String, long, boolean, java.util.Collection)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将其视为“ls”命令来列出目录中的条目。目录本身将表示为“.”。或者更好地说,条目的名称是相对于目录的,对于目录本身来说,它是一个空字符串。
使用 dirEntry.getURL() 然后您可以从 URL 的路径计算名称。此外,目录名称可以是“path”参数的一部分,也可以是 SVNRepository 对象位置 URL 的一部分。
Treat it like "ls" command to list entries in the directory. The directory itself will be represented as ".". Or better to say that name of the entry is relative to the directory and for the directory itself it is an empty string.
Use dirEntry.getURL() and then you may compute name from the URL's path. Also, directory name is either part of the "path" parameter or part of the SVNRepository object location URL.
我已经检查过,
getDir()
方法返回的SVNDirEntry
始终将其 name 属性设置为空字符串。但是,当使用该方法获取列出的目录时,每个目录条目都会正确分配其名称。
我认为这种行为有些错误,尽管您仍然可以通过其 URL 找到
SVNDirEntry
的名称:I've checked and the
SVNDirEntry
returned by thegetDir()
method always has its name attribute set to an empty string.However when that method is used to fetch a directory listing each directory entry has its name properly assigned.
I think that behavior is somewhat buggy though you can still find out the name of an
SVNDirEntry
through its URL: