SVNDirEntry parentEntry = null;
try {
openConnection();
final SVNURL url = getLocation().setPath(getFullPath(path), false);
final SVNURL repositoryRoot = getRepositoryRoot(false);
ISVNDirEntryHandler handler = new ISVNDirEntryHandler() {
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);
}
}
};
path = getRepositoryPath(path);
// get parent
Object[] buffer = new Object[]{"stat", path, getRevisionObject(revision)};
write("(w(s(n)))", buffer);
authenticate();
List values = read("(?l)", null, false);
values = (List) values.get(0);
if (values != null) {
List direntProps = SVNReader.parseTuple("wnsr(?s)(?s)", values, null);
SVNNodeKind kind = SVNNodeKind.parseKind(SVNReader.getString(direntProps, 0));
long size = SVNReader.getLong(direntProps, 1);
boolean hasProps = SVNReader.getBoolean(direntProps, 2);
long createdRevision = SVNReader.getLong(direntProps, 3);
Date createdDate = SVNDate.parseDate(SVNReader.getString(direntProps, 4));
String lastAuthor = SVNReader.getString(direntProps, 5);
parentEntry = new SVNDirEntry(url, repositoryRoot, "", kind, size, hasProps, createdRevision, createdDate, lastAuthor);
}
// get entries.
buffer = new Object[]{"get-dir", path, rev, Boolean.FALSE, Boolean.TRUE};
write("(w(s(n)ww))", buffer);
authenticate();
values = read("rll", null, false);
revision = values.get(0) != null ? SVNReader.getLong(values, 0) : revision;
if (handler != null) {
List dirents = (List) values.get(2);
for (Iterator iterator = dirents.iterator(); iterator.hasNext();) {
SVNItem item = (SVNItem) iterator.next();
if (item.getKind() != SVNItem.LIST) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.RA_SVN_MALFORMED_DATA, "Dirlist element not a list");
SVNErrorManager.error(err, SVNLogType.NETWORK);
}
List direntProps = SVNReader.parseTuple("swnsr(?s)(?s)", item.getItems(), null);
String name = SVNReader.getString(direntProps, 0);
SVNNodeKind kind = SVNNodeKind.parseKind(SVNReader.getString(direntProps, 1));
long size = SVNReader.getLong(direntProps, 2);
boolean hasProps = SVNReader.getBoolean(direntProps, 3);
long createdRevision = SVNReader.getLong(direntProps, 4);
Date createdDate = SVNDate.parseDate(SVNReader.getString(direntProps, 5));
String lastAuthor = SVNReader.getString(direntProps, 6);
handler.handleDirEntry(new SVNDirEntry(url.appendPath(name, false), repositoryRoot, name, kind, size, hasProps, createdRevision, createdDate, lastAuthor));
}
}
// get comments.
if (includeComment && entries != null) {