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)
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.