public SVNLock doLock(String path, DAVRepository repos, String comment, boolean force, long revision) throws SVNException {
DAVBaselineInfo info = DAVUtil.getBaselineInfo(this, repos, path, -1, false, true, null);
StringBuffer body = DAVLockHandler.generateSetLockRequest(null, comment);
HTTPHeader header = new HTTPHeader();
header.setHeaderValue(HTTPHeader.DEPTH_HEADER, "0");
header.setHeaderValue(HTTPHeader.TIMEOUT_HEADER, "Infinite");
header.setHeaderValue(HTTPHeader.CONTENT_TYPE_HEADER, "text/xml; charset=\"utf-8\"");
if (revision >= 0) {
header.setHeaderValue(HTTPHeader.SVN_VERSION_NAME_HEADER, Long.toString(revision));
}
if (force) {
header.setHeaderValue(HTTPHeader.SVN_OPTIONS_HEADER, "lock-steal");
}
DAVLockHandler handler = new DAVLockHandler();
SVNErrorMessage context = SVNErrorMessage.create(SVNErrorCode.RA_DAV_REQUEST_FAILED, "Lock request failed");
IHTTPConnection httpConnection = getConnection();
HTTPStatus status = httpConnection.request("LOCK", path, header, body, -1, 0, null, handler, context);