use of org.apache.jackrabbit.oak.remote.RemoteTreeFilters in project jackrabbit-oak by apache.
the class HeadTreeHandler method handle.
@Override
public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
RemoteSession session = (RemoteSession) request.getAttribute("session");
if (session == null) {
sendInternalServerError(response, "session not found");
return;
}
RemoteRevision revision = readRevision(request, session);
if (revision == null) {
sendGone(response, "revision not found");
return;
}
RemoteTree tree = session.readTree(revision, readPath(request), new RemoteTreeFilters());
if (tree == null) {
sendNotFound(response, singletonMap("Oak-Revision", revision.asString()), "tree not found");
return;
}
response.setStatus(HttpServletResponse.SC_OK);
response.setHeader("Oak-Revision", revision.asString());
response.setContentType("application/json");
}
Aggregations