private Node getNode(final String path) throws RepositoryException { try { return getJcrSession(session).getNode(path); } catch (final IllegalArgumentException ex) { throw new InvalidResourceIdentifierException("Illegal path: " + path); } }
@Override public Response toResponse(final InvalidResourceIdentifierException e) { LOGGER.error("InvalidResourceIdentifierExceptionMapper caught an exception: {}", e.getMessage()); debugException(this, e, LOGGER); return status(BAD_REQUEST).entity(e.getMessage()).type(TEXT_PLAIN_WITH_CHARSET).build(); } }
throw new InvalidResourceIdentifierException("Path contains empty element! " + path);
@Override public boolean exists(final FedoraSession session, final String path) { final Session jcrSession = getJcrSession(session); try { validatePath(jcrSession, path); return jcrSession.nodeExists(path); } catch (final IllegalArgumentException e) { throw new InvalidResourceIdentifierException("Illegal path: " + path); } catch (final RepositoryException e) { throw new RepositoryRuntimeException(e); } }