}
catch (Exception e) {} // ignore silently
if (collectionNode == null || !isCollection(collectionUri)) {
throw new PreconditionViolationException(
new ViolatedPrecondition(C_BIND_INTO_COLLECTION, WebdavStatus.SC_CONFLICT), collectionUri);
}
if (!MethodUtil.isValidSegment(segment)) {
throw new PreconditionViolationException(
new ViolatedPrecondition(C_NAME_ALLOWED, WebdavStatus.SC_FORBIDDEN), segment);
}
if (sourceNode == null) {
throw new PreconditionViolationException(
new ViolatedPrecondition(C_BIND_SOURCE_EXISTS, WebdavStatus.SC_CONFLICT), sourceUri);
}
if (collectionNode.hasBinding(segment)) {
if (overwrite) {
resp.setStatus( WebdavStatus.SC_NO_CONTENT );
}
else {
throw new PreconditionViolationException(
new ViolatedPrecondition(C_CAN_OVERWRITE, WebdavStatus.SC_FORBIDDEN), segment);
}
}
if (isCollection(sourceUri)) {
if (isDescendant(collectionNode, sourceNode)) {
throw new PreconditionViolationException(
new ViolatedPrecondition(C_CYCLE_ALLOWED, WebdavStatus.SC_FORBIDDEN), sourceUri);
}
}
}