public LockMethod(String uri, LockInfo lockInfo) throws IOException {
super(uri);
if (lockInfo != null && !lockInfo.isRefreshLock()) {
TimeoutHeader th = new TimeoutHeader(lockInfo.getTimeout());
setRequestHeader(th);
DepthHeader dh = new DepthHeader(lockInfo.isDeep());
setRequestHeader(dh);
setRequestBody(lockInfo);
isRefresh = false;
} else {
throw new IllegalArgumentException("Cannot create a LOCK request without lock info. Use the constructor taking lock tokens in order to build a LOCK request for refresh.");