if (userId == null)
userId = getUserId();
if (userId != null && userId.length() > 15)
userId = userId.substring(0, 14) + "*";
ClientHttpRequest request = new ClientHttpRequest(remoteUrl);
request.setParameter(VERSION_PARAM, CLIENT_VERSION);
request.setParameter(ACTION_PARAM, action);
maybeSetParameter(request, EXTRA_INFO_PARAM, userName);
maybeSetParameter(request, USER_ID_PARAM, userId);
maybeSetParameter(request, SOURCE_IDENTIFIER, sourceIdentifier);
maybeSetParameter(request, EXTRA_LOCK_DATA, extraLockData);
try {
InputStream in = request.post(params);
if (responseAnalyzer != null)
responseAnalyzer.analyze(request.getConnection());
return FileUtils.slurpContents(in, true);
} catch (IOException ioe) {
checkForLockException(request.getConnection());
throw ioe;
}
}