in src/main/java/org/apache/sling/servlets/post/impl/operations/CheckoutOperation.java [42:74]
protected void doRun(
SlingJakartaHttpServletRequest request, JakartaPostResponse response, List<Modification> changes)
throws PersistenceException {
try {
Iterator<Resource> res = getApplyToResources(request);
if (res == null) {
Resource resource = request.getResource();
Node node = resource.adaptTo(Node.class);
if (node == null) {
response.setStatus(
HttpServletResponse.SC_NOT_FOUND, "Missing source " + resource + " for checkout");
return;
}
node.getSession().getWorkspace().getVersionManager().checkout(node.getPath());
changes.add(Modification.onCheckout(resource.getPath()));
} else {
while (res.hasNext()) {
Resource resource = res.next();
Node node = resource.adaptTo(Node.class);
if (node != null) {
node.getSession().getWorkspace().getVersionManager().checkout(node.getPath());
changes.add(Modification.onCheckout(resource.getPath()));
}
}
}
} catch (final RepositoryException re) {
throw new PersistenceException(re.getMessage(), re);
}
}