private SVNDirEntry createDirEntry(String fullPath, DAVProperties child) throws SVNException { String href = child.getURL(); href = SVNEncodingUtil.uriDecode(href); String name = SVNPathUtil.tail(href); // build direntry SVNNodeKind kind = SVNNodeKind.FILE; Object revisionStr = child.getPropertyValue(DAVElement.VERSION_NAME); long lastRevision = Long.parseLong(revisionStr.toString()); String sizeStr = child.getPropertyValue(DAVElement.GET_CONTENT_LENGTH); long size = sizeStr == null ? 0 : Long.parseLong(sizeStr); if (child.isCollection()) { kind = SVNNodeKind.DIR; } String author = child.getPropertyValue(DAVElement.CREATOR_DISPLAY_NAME); String dateStr = child.getPropertyValue(DAVElement.CREATION_DATE); Date date = dateStr != null ? SVNTimeUtil.parseDate(dateStr) : null; boolean hasProperties = false; for(Iterator props = child.getProperties().keySet().iterator(); props.hasNext();) { DAVElement property = (DAVElement) props.next(); if (DAVElement.SVN_CUSTOM_PROPERTY_NAMESPACE.equals(property.getNamespace()) || DAVElement.SVN_SVN_PROPERTY_NAMESPACE.equals(property.getNamespace())) { hasProperties = true; break; } } SVNURL url = getLocation().setPath(fullPath, true); return new SVNDirEntry(url, name, kind, size, hasProperties, lastRevision, date, author); } }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { if (entries != null) { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), repositoryRoot, dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry = new SVNDirEntry(url.appendPath(dirEntry.getName(), false), dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor()); entries.add(dirEntry); } };
private SVNDirEntry buildDirEntry(FSEntry repEntry, SVNURL parentURL, FSRevisionNode entryNode, boolean includeLogs) throws SVNException { entryNode = entryNode == null ? myFSFS.getRevisionNode(repEntry.getId()) : entryNode; long size = 0; if (entryNode.getType() == SVNNodeKind.FILE) { size = entryNode.getFileLength(); } Map props = null; props = entryNode.getProperties(myFSFS); boolean hasProps = (props == null || props.size() == 0) ? false : true; Map revProps = null; revProps = myFSFS.getRevisionProperties(repEntry.getId().getRevision()); String lastAuthor = null; String log = null; Date lastCommitDate = null; if (revProps != null && revProps.size() > 0) { lastAuthor = (String) revProps.get(SVNRevisionProperty.AUTHOR); log = (String) revProps.get(SVNRevisionProperty.LOG); String timeString = (String) revProps.get(SVNRevisionProperty.DATE); lastCommitDate = timeString != null ? SVNTimeUtil.parseDateString(timeString) : null; } SVNURL entryURL = parentURL.appendPath(repEntry.getName(), false); SVNDirEntry dirEntry = new SVNDirEntry(entryURL, repEntry.getName(), repEntry.getType(), size, hasProps, repEntry.getId().getRevision(), lastCommitDate, lastAuthor, includeLogs ? log : null); dirEntry.setRelativePath(repEntry.getName()); return dirEntry; }
SVNURL url = getLocation().setPath(fullPath, true); String name = repositoryRoot.equals(url) ? "" : SVNPathUtil.tail(href); return new SVNDirEntry(url, repositoryRoot, name, kind, size, hasProperties, lastRevision, date, author);
private static SVNDirEntry readStatEntry(InputStream is) throws SVNException { Object[] items = SVNReader.parse(is, "(WNTN(?S)(?S))", null); SVNNodeKind kind = SVNNodeKind.parseKind(SVNReader.getString(items, 0)); long size = SVNReader.getLong(items, 1); boolean hasProps = SVNReader.getBoolean(items, 2); long revision = SVNReader.getLong(items, 3); Date date = items[4] != null ? SVNTimeUtil.parseDate(SVNReader.getString(items, 4)) : null; String author = SVNReader.getString(items, 5); return new SVNDirEntry(null, null, kind, size, hasProps, revision, date, author); }
SVNURL repositoryRoot = getRepositoryRoot(false); SVNURL url = getLocation().setPath(fullPath, true); return new SVNDirEntry(url, repositoryRoot, name, kind, size, hasProperties, lastRevision, date, author);
SVNURL repositoryRoot = getRepositoryRoot(false); SVNURL url = getLocation().setPath(fullPath, true); return new SVNDirEntry(url, repositoryRoot, name, kind, size, hasProperties, lastRevision, date, author);
private static SVNDirEntry readDirEntry(InputStream is) throws SVNException { Object[] items = SVNReader.parse(is, "(SWNTN(?S)(?S))", null); String name = SVNReader.getString(items, 0); SVNNodeKind kind = SVNNodeKind.parseKind(SVNReader.getString(items, 1)); long size = SVNReader.getLong(items, 2); boolean hasProps = SVNReader.getBoolean(items, 3); long revision = SVNReader.getLong(items, 4); Date date = items[5] != null ? SVNTimeUtil.parseDate(SVNReader.getString(items, 5)) : null; String author = SVNReader.getString(items, 6); return new SVNDirEntry(null, name, kind, size, hasProps, revision, date, author); }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { handler.handleDirEntry(new SVNDirEntry(url.appendPath(dirEntry.getName(), false), dirEntry.getName(), dirEntry.getKind(), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate(), dirEntry.getAuthor())); } };
read("[((?F))]", buffer, true); parentEntry = (SVNDirEntry) buffer[0]; parentEntry = new SVNDirEntry(url, "", parentEntry.getKind(), parentEntry.getSize(), parentEntry.hasProperties(), parentEntry.getRevision(), parentEntry.getDate(), parentEntry.getAuthor());
Date createdDate = SVNDate.parseDate(SVNReader.getString(values, 4)); String lastAuthor = SVNReader.getString(values, 5); entry = new SVNDirEntry(url, repositoryRoot, "".equals(path) ? SVNPathUtil.tail(getLocation().getPath()) : SVNPathUtil.tail(path), kind, size, hasProperties, createdRevision, createdDate, lastAuthor);
Date createdDate = SVNDate.parseDate(SVNReader.getString(values, 4)); String lastAuthor = SVNReader.getString(values, 5); entry = new SVNDirEntry(url, repositoryRoot, SVNPathUtil.tail(path), kind, size, hasProperties, createdRevision, createdDate, lastAuthor);
Date createdDate = SVNDate.parseDate(SVNReader.getString(values, 4)); String lastAuthor = SVNReader.getString(values, 5); entry = new SVNDirEntry(url, repositoryRoot, SVNPathUtil.tail(path), kind, size, hasProperties, createdRevision, createdDate, lastAuthor);
public SVNDirEntry info(String path, long revision) throws SVNException { try { openConnection(); String fullPath = getFullPath(path); SVNURL url = getLocation().setPath(fullPath, false); path = getRepositoryPath(path); Object[] buffer = new Object[] { "stat", path, getRevisionObject(revision) }; write("(w(s(n)))", buffer); authenticate(); read("[((?F))]", buffer, true); SVNDirEntry entry = (SVNDirEntry) buffer[0]; if (entry != null) { entry = new SVNDirEntry(url, SVNPathUtil.tail(path), entry.getKind(), entry.getSize(), entry.hasProperties(), entry.getRevision(), entry.getDate(), entry.getAuthor()); } return entry; } catch (SVNException e) { closeSession(); handleUnsupportedCommand(e, "'stat' not implemented"); } finally { closeConnection(); } return null; }
SVNDirEntry dirEntry = new SVNDirEntry(entryURL, getRepositoryRoot(false), repEntry.getName(), kind, size, hasProps, revision, lastCommitDate, lastAuthor, log); dirEntry.setRelativePath(repEntry.getName()); return dirEntry;
SVNDirEntry dirEntry = new SVNDirEntry(entryURL, getRepositoryRoot(false), repEntry.getName(), kind, size, hasProps, revision, lastCommitDate, lastAuthor, log); dirEntry.setRelativePath(repEntry.getName()); return dirEntry;
SVNDirEntry dirEntry = new SVNDirEntry(entryURL, getRepositoryRoot(false), repEntry.getName(), kind, size, hasProps, revision, lastCommitDate, lastAuthor, log); dirEntry.setRelativePath(repEntry.getName()); return dirEntry;