protected Item getItem(JcrDavSession sessionImpl, DavResourceLocator locator) throws PathNotFoundException, RepositoryException {
if (locator instanceof WrappingLocator && ((WrappingLocator)locator).isJsonRequest) {
// check if the .json extension has been correctly interpreted.
Session s = sessionImpl.getRepositorySession();
try {
if (s.itemExists(((WrappingLocator)locator).loc.getRepositoryPath())) {
// an item exists with the original calculated repo-path
// -> assume that the repository item path ends with .json
// or .depth.json. i.e. .json wasn't an extra extension
// appended to request the json-serialization of the node.
// -> change the flag in the WrappingLocator correspondingly.