public static Map getWorkingCopyPropertyValues(File path, SVNEntry entry, final String propName,
SVNDepth depth, final boolean base) throws SVNException {
final Map pathsToPropValues = new SVNHashMap();
ISVNEntryHandler handler = new ISVNEntryHandler() {
public void handleEntry(File itemPath, SVNEntry itemEntry) throws SVNException {
SVNAdminArea adminArea = itemEntry.getAdminArea();
if (itemEntry.isDirectory() && !itemEntry.getName().equals(adminArea.getThisDirName())) {
return;
}
if ((itemEntry.isScheduledForAddition() && base) ||
(itemEntry.isScheduledForDeletion() && !base)) {
return;
}
SVNPropertyValue propValue = null;
SVNWCAccess access = adminArea.getWCAccess();
if (base) {
SVNEntry pathEntry = access.getEntry(itemPath, false);
if (pathEntry != null) {
SVNAdminArea pathArea = pathEntry.getAdminArea();
SVNVersionedProperties baseProps = pathArea.getBaseProperties(pathEntry.getName());
propValue = baseProps.getPropertyValue(propName);
}
} else {
SVNEntry pathEntry = access.getEntry(itemPath, true);
if (pathEntry != null) {
SVNAdminArea pathArea = pathEntry.getAdminArea();
SVNVersionedProperties workingProps = pathArea.getProperties(pathEntry.getName());
propValue = workingProps.getPropertyValue(propName);
}
}
if (propValue != null) {
pathsToPropValues.put(itemPath, propValue);
}
}
public void handleError(File path, SVNErrorMessage error) throws SVNException {
while (error.hasChildErrorMessage()) {
error = error.getChildErrorMessage();
}
if (error.getErrorCode() == SVNErrorCode.WC_PATH_NOT_FOUND) {
return;
}
SVNErrorManager.error(error, SVNLogType.WC);
}
};
if (depth == SVNDepth.UNKNOWN) {
depth = SVNDepth.INFINITY;
}
SVNAdminArea adminArea = entry.getAdminArea();
if (entry.isDirectory() && depth.compareTo(SVNDepth.FILES) >= 0) {
SVNWCAccess wcAccess = adminArea.getWCAccess();
wcAccess.walkEntries(path, handler, false, depth);
} else {
handler.handleEntry(path, entry);
}
return pathsToPropValues;
}