Long rev = getRevisionObject(revision);
try {
openConnection();
String fullPath = getFullPath(path);
final SVNURL url = getLocation().setPath(fullPath, false);
path = getRepositoryPath(path);
List individualProps = new LinkedList();
if ((entryFields & SVNDirEntry.DIRENT_KIND) != 0) {
individualProps.add(DIRENT_KIND);
}
if ((entryFields & SVNDirEntry.DIRENT_SIZE) != 0) {
individualProps.add(DIRENT_SIZE);
}
if ((entryFields & SVNDirEntry.DIRENT_HAS_PROPERTIES) != 0) {
individualProps.add(DIRENT_HAS_PROPS);
}
if ((entryFields & SVNDirEntry.DIRENT_CREATED_REVISION) != 0) {
individualProps.add(DIRENT_CREATED_REV);
}
if ((entryFields & SVNDirEntry.DIRENT_TIME) != 0) {
individualProps.add(DIRENT_TIME);
}
if ((entryFields & SVNDirEntry.DIRENT_LAST_AUTHOR) != 0) {
individualProps.add(DIRENT_LAST_AUTHOR);
}
Object[] buffer = new Object[]{"get-dir", path, rev,
Boolean.valueOf(properties != null),
Boolean.valueOf(handler != null),
individualProps.size() > 0 ?
(String[]) individualProps.toArray(new String[individualProps.size()]) :
null};
write("(w(s(n)ww(*w)))", buffer);
authenticate();
List values = read("rll", null, false);
revision = values.get(0) != null ? SVNReader.getLong(values, 0) : revision;
if (properties != null) {
SVNReader.getProperties(values, 1, properties);
}
if (handler != null) {
SVNURL repositoryRoot = getRepositoryRoot(false);
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");