try {
lastRevision = Long.parseLong(revisionStr.toString());
} catch (NumberFormatException nfe) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, nfe), SVNLogType.NETWORK);
}
SVNPropertyValue sizeValue = child.getPropertyValue(DAVElement.GET_CONTENT_LENGTH);
long size = 0;
if (sizeValue != null) {
try {
size = Long.parseLong(sizeValue.getString());
} catch (NumberFormatException nfe) {
SVNErrorManager.error(SVNErrorMessage.create(SVNErrorCode.RA_DAV_MALFORMED_DATA, nfe), SVNLogType.NETWORK);
}
}
if (child.isCollection()) {
kind = SVNNodeKind.DIR;
}
SVNPropertyValue authorValue = child.getPropertyValue(DAVElement.CREATOR_DISPLAY_NAME);
String author = authorValue == null ? null : authorValue.getString();
SVNPropertyValue dateValue = child.getPropertyValue(DAVElement.CREATION_DATE);
Date date = dateValue != null ? SVNDate.parseDate(dateValue.getString()) : null;
connection.fetchRepositoryRoot(this);
SVNURL repositoryRoot = getRepositoryRoot(false);
SVNURL childURL = getLocation().setPath(fullPath, true);
if ("".equals(name)) {
parent[0] = new SVNDirEntry(childURL, repositoryRoot, name, kind, size, false, lastRevision,
date, author);
SVNPropertyValue vcc = child.getPropertyValue(DAVElement.VERSION_CONTROLLED_CONFIGURATION);
parentVCC[0] = vcc == null ? null : vcc.getString();
} else {
childURL = childURL.appendPath(name, false);
if (entries != null) {
entries.add(new SVNDirEntry(childURL, repositoryRoot, 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 != null ? entries.iterator() : null;
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(connection, 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 != null && ents.hasNext()) {
entry = (SVNDirEntry) ents.next();
SVNPropertyValue vccValue = (SVNPropertyValue) vccs.get(index);
vcc = vccValue != null ? vccValue.getString() : null;
index++;
} else {
break;
}
}