use of org.apache.jackrabbit.webdav.client.methods.HttpLabel in project jackrabbit by apache.
the class RepositoryServiceImpl method removeVersionLabel.
@Override
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws RepositoryException {
HttpLabel request = null;
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
request = new HttpLabel(uri, new LabelInfo(strLabel, LabelInfo.TYPE_REMOVE));
initMethod(request, sessionInfo, !isUnLockMethod(request));
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
}
}
use of org.apache.jackrabbit.webdav.client.methods.HttpLabel in project jackrabbit by apache.
the class RepositoryServiceImpl method addVersionLabel.
@Override
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws RepositoryException {
HttpLabel request = null;
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
request = new HttpLabel(uri, new LabelInfo(strLabel, moveLabel ? LabelInfo.TYPE_SET : LabelInfo.TYPE_ADD));
initMethod(request, sessionInfo, !isUnLockMethod(request));
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
}
}
Aggregations