Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNDirEntry


           
            FSRevisionNode parent = root.getRevisionNode(repositoryPath);
            if (entries != null) {
                entries.addAll(getDirEntries(parent, parentURL, includeCommitMessages));
            }
            SVNDirEntry parentDirEntry = buildDirEntry(new FSEntry(parent.getId(), parent.getType(), ""), parentURL, parent, false);
            return parentDirEntry;
        } finally {
            closeRepository();
        }
    }
View Full Code Here


            String fullPath = getFullPath(path);
            String parentFullPath = "/".equals(path) ? fullPath : SVNPathUtil.removeTail(fullPath);
            SVNURL url = getLocation().setPath(parentFullPath, false);
            String name = SVNPathUtil.tail(path);
            FSEntry fsEntry = new FSEntry(revNode.getId(), revNode.getType(), name);
            SVNDirEntry entry = buildDirEntry(fsEntry, url, revNode, false);
            return entry;
        } finally {
            closeRepository();
        }
    }
View Full Code Here

                            break;
                        }
                    }
                    SVNURL childURL = getLocation().setPath(fullPath, true);
                    childURL = childURL.appendPath(name, false);
                    SVNDirEntry dirEntry = new SVNDirEntry(childURL, name, kind, size, hasProperties, lastRevision, date, author);
                    handler.handleDirEntry(dirEntry);
                }               
            }
            if (properties != null) {
                DAVProperties dirProps = DAVUtil.getResourceProperties(myConnection, path, null, null);
View Full Code Here

                String author = child.getPropertyValue(DAVElement.CREATOR_DISPLAY_NAME);
                String dateStr = child.getPropertyValue(DAVElement.CREATION_DATE);
                Date date = dateStr != null ? SVNTimeUtil.parseDate(dateStr) : null;
                SVNURL childURL = getLocation().setPath(fullPath, true);
                if ("".equals(name)) {
                    parent[0] = new SVNDirEntry(childURL, name, kind, size, false, lastRevision, date, author);
                    parentVCC[0] = child.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION);
                } else {
                    childURL = childURL.appendPath(name, false);
                    entries.add(new SVNDirEntry(childURL, name, kind, size, false, lastRevision, date, author));
                    vccs.add(child.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION));
                }
            }

            if (includeComments) {
                DAVElement logProperty = DAVElement.getElement(DAVElement.SVN_SVN_PROPERTY_NAMESPACE, "log");
                Iterator ents = entries.iterator();
                SVNDirEntry entry = parent[0];
                String vcc = parentVCC[0];
                int index = 0;
                while(true) {
                    String label = Long.toString(entry.getRevision());
                    if (entry.getDate() != null && getOptions().hasCommitMessage(this, entry.getRevision())) {
                        String message = getOptions().getCommitMessage(this, entry.getRevision());
                        entry.setCommitMessage(message);
                    } else if (entry.getDate() != null) {
                        final SVNDirEntry currentEntry = entry;
                        String commitMessage = null;
                        try {
                            commitMessage = DAVUtil.getPropertyValue(myConnection, vcc, label, logProperty);
                        } catch (SVNException e) {
                            if (e.getErrorMessage().getErrorCode() != SVNErrorCode.RA_DAV_PROPS_NOT_FOUND) {
                                throw e;
                            }
                        }
                        getOptions().saveCommitMessage(DAVRepository.this, currentEntry.getRevision(), commitMessage);
                        currentEntry.setCommitMessage(commitMessage);
                    }
                    if (ents.hasNext()) {
                        entry = (SVNDirEntry) ents.next();
                        vcc = (String) vccs.get(index);
                        index++;
View Full Code Here

                hasProperties = true;
                break;
            }
        }
        SVNURL url = getLocation().setPath(fullPath, true);
        return new SVNDirEntry(url, name, kind, size, hasProperties, lastRevision, date, author);
    }
View Full Code Here

        }

        SVNRepository repos = createRepository(url, null, pegRevision, revision);;
        url = repos.getLocation();
        long revNum = getRevisionNumber(revision, repos, null);
        SVNDirEntry rootEntry = null;
        try {
            rootEntry = repos.info("", revNum);
        } catch (SVNException e) {
            if (e.getErrorMessage() != null && e.getErrorMessage().getErrorCode() == SVNErrorCode.RA_NOT_IMPLEMENTED) {
                // for svnserve older then 1.2.0
                if (repos.getLocation().equals(repos.getRepositoryRoot(true))) {
                    rootEntry = new SVNDirEntry(url, "", SVNNodeKind.DIR, -1, false, -1, null, null);
                } else {
                    String name = SVNPathUtil.tail(url.getPath());
                    SVNURL location = repos.getLocation();
                    repos.setLocation(location.removePathTail(), false);
                    Collection dirEntries = repos.getDir("", revNum, null, (Collection) null);
                    for (Iterator ents = dirEntries.iterator(); ents.hasNext();) {
                        SVNDirEntry dirEntry = (SVNDirEntry) ents.next();
                        // dir entry name may differ from 'name', due to renames...
                        if (name.equals(dirEntry.getName())) {
                            rootEntry = dirEntry;
                            break;
                        }
                    }
                    repos.setLocation(location, false);
View Full Code Here

        }
        handler.handleInfo(SVNInfo.createInfo(displayPath, root, uuid, url, rev, entry, (SVNLock) locks.get(path)));
        if (entry.getKind() == SVNNodeKind.DIR && recursive) {
            Collection children = repos.getDir(path, rev.getNumber(), null, new ArrayList());
            for (Iterator ents = children.iterator(); ents.hasNext();) {
                SVNDirEntry child = (SVNDirEntry) ents.next();
                SVNURL childURL = url.appendPath(child.getName(), false);
                collectInfo(repos, child, rev, SVNPathUtil.append(path, child.getName()), root, uuid, childURL, locks, recursive, handler);
            }
        }
    }
View Full Code Here

                }
            }
            if (recursive) {
                checkCancelled();
                for (Iterator entries = children.iterator(); entries.hasNext();) {
                    SVNDirEntry child = (SVNDirEntry) entries.next();
                    SVNURL childURL = url.appendPath(child.getName(), false);
                    String childPath = "".equals(path) ? child.getName() : SVNPathUtil.append(path, child.getName());
                    doGetRemoteProperty(childURL, childPath, repos, propName, rev, recursive, handler);
                }
            }
        } else if (kind == SVNNodeKind.FILE) {
            repos.getFile(path, revNumber, props, null);
View Full Code Here

     *
     */
    public void endTarget() {
        try {
            for (Iterator ents = myDirEntries.iterator(); ents.hasNext();) {
                SVNDirEntry entry = (SVNDirEntry) ents.next();
                sendToHandler(entry);
            }
            myDirEntries = null;
            closeTag(LIST_TAG);
        } catch (SAXException e) {
View Full Code Here

     */
    public int compare(Object o1, Object o2) {
        if (o1 == o2) {
            return 0;
        }
        SVNDirEntry e1 = (SVNDirEntry) o1;
        SVNDirEntry e2 = (SVNDirEntry) o2;
        if (e1 == null) {
            return -1;
        } else if (e2 == null) {
            return 1;
        }
        return SVNPathUtil.PATH_COMPARATOR.compare(e1.getRelativePath(), e2.getRelativePath());
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNDirEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.