String locationPath = getLocation().getPath();
locationPath = SVNEncodingUtil.uriEncode(locationPath);
request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, myLocks);
}
IHTTPConnection httpConnection = getConnection();
HTTPStatus status = httpConnection.request("DELETE", path, header, request, 204, 0, null, null);
if (status.getError() != null) {
SVNErrorCode errCode = status.getError().getErrorCode();
if (errCode == SVNErrorCode.FS_BAD_LOCK_TOKEN || errCode == SVNErrorCode.FS_NO_LOCK_TOKEN ||
errCode == SVNErrorCode.FS_LOCK_OWNER_MISMATCH || errCode == SVNErrorCode.FS_PATH_ALREADY_LOCKED) {
Map childTokens = null;
if (myLocks != null) {
childTokens = new SVNHashMap();
for (Iterator locksIter = myLocks.keySet().iterator(); locksIter.hasNext();) {
String lockPath = (String) locksIter.next();
if (lockPath.startsWith(path)) {
childTokens.put(lockPath, myLocks.get(lockPath));
}
}
}
if (childTokens == null || childTokens.isEmpty()) {
SVNErrorManager.error(status.getError(), SVNLogType.NETWORK);
} else {
status.setError(null);
}
String token = myLocks != null ? (String) myLocks.get(path) : null;
if (token != null) {
childTokens.put(path, token);
}
request = new StringBuffer();
String locationPath = getLocation().getPath();
locationPath = SVNEncodingUtil.uriEncode(locationPath);
request = DAVMergeHandler.generateLockDataRequest(request, locationPath, repositoryPath, childTokens);
HTTPStatus status2 = httpConnection.request("DELETE", path, header, request, 204, 404, null, null);
if (status2.getError() != null) {
SVNErrorManager.error(status2.getError(), SVNLogType.NETWORK);
}
return status2;
}