Differences between revisions 3 and 4
Revision 3 as of 2008-09-05 17:46:32
Size: 905
Editor: 194
Comment:
Revision 4 as of 2008-09-05 17:53:59
Size: 1218
Editor: 194
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
    public void fetchPropsFromRepository(SVNRepository repos) throws SVNException {
        repos.getDir();
    public void fetchPropsFromRepository(SVNRepository repos, String path, long revision, Map pathsToProps, ) throws SVNException {
        SVNProperties props = new SVNProperties();
        Collection children = repos.getDir(path, revision, props, SVNDirEntry.DIRENT_ALL, null);
        pathsToProps.put(path, props);
        for (Iterator childrenIter = children.iterator(); childrenIter.hasNext();) {
            

SVNRepository.getStatus() vs. SVNRepository.getDir()

Here we will show how you can fetch properties from the repository recursively in a single request using SVNRepository. Many newbie users who come across the SVNRepository interface for the first time, decide to implement the task of recursive retrieving properties from a repository tree with the help of SVNRepository's getDir() method. To get properties recursively you'll have to call getDir() in recursion. It's not a wrong way, but consider the repository tree with multiple leaves (with hundreds or maybe thousands of them). For each directory leave getDir() sends a new request what leads to extremely slow performance.

Basically, what you do with getDir() is the following:

   1     public void fetchPropsFromRepository(SVNRepository repos, String path, long revision, Map pathsToProps, ) throws SVNException {
   2         SVNProperties props = new SVNProperties();
   3         Collection children = repos.getDir(path, revision, props, SVNDirEntry.DIRENT_ALL, null);
   4         pathsToProps.put(path, props);
   5         for (Iterator childrenIter = children.iterator(); childrenIter.hasNext();) {
   6             
   7     }

Recursively fetching properties from a repository (low-level API) (last edited 2008-09-05 18:59:11 by 194)