/** * Forwards the method call to the underlying session. */ public String getNamespaceURI(String prefix) throws NamespaceException, RepositoryException { return session.getNamespaceURI(prefix); }
private boolean isNamespaceRegistered(final String prefix) throws RepositoryException { try { session.getNamespaceURI(prefix); return true; } catch (NamespaceException e) { return false; } }
public String getNamespaceURI(String prefix) { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { throw new RuntimeException(e); } } }
public String getNamespaceURI(String prefix) { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { throw new RuntimeException(e); } } }
private void addNamespace(Session s, String name) throws RepositoryException { int idx = name.indexOf(':'); if (idx > 0) { String prefix = name.substring(0, idx); String uri = s.getNamespaceURI(prefix); namespaces.put(uri, prefix); } }
private String getExpandedName(String jcrName) throws RepositoryException { if (jcrName.startsWith("{")) { return jcrName; } else { int pos = jcrName.indexOf(":"); String prefix = (pos > -1) ? jcrName.substring(0, pos) : ""; String uri = superuser.getNamespaceURI(prefix); return "{" + uri + "}" + jcrName.substring(pos+1); } }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { throw new NamespaceException(e); } }
/** * Return namespace URI. */ public String getNamespaceURI(String arg0) throws NamespaceException, RepositoryException { return getSession().getNamespaceURI(arg0); }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { // should never get here... throw new NamespaceException("internal error: failed to resolve namespace prefix", e); } } }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { // should never get here... throw new NamespaceException("internal error: failed to resolve namespace prefix", e); } } }
@Override default String getNamespaceURI(final String prefix) throws NamespaceException, RepositoryException { return unwrapSession().getNamespaceURI(prefix); }
/** * Return namespace URI. */ public String getNamespaceURI(String arg0) throws NamespaceException, RepositoryException { return getSession().getNamespaceURI(arg0); }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { // should never get here... throw new NamespaceException("internal error: failed to resolve namespace prefix", e); } } }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { // should never get here... throw new NamespaceException("internal error: failed to resolve namespace prefix", e); } } }
/** * {@inheritDoc} */ public String getURI(String prefix) throws NamespaceException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException e) { throw new NamespaceException(e); } }
/** {@inheritDoc} */ public String getNamespaceURI(String prefix) throws RepositoryException, RemoteException { try { return session.getNamespaceURI(prefix); } catch (RepositoryException ex) { throw getRepositoryException(ex); } }
public CurrentUserPrivilegeSetProperty asDavProperty() throws RepositoryException { List<Privilege> davPrivs = new ArrayList<Privilege>(); for (javax.jcr.security.Privilege privilege : session.getAccessControlManager().getPrivileges(absPath)) { String privilegeName = privilege.getName(); String prefix = Text.getNamespacePrefix(privilegeName); Namespace ns = (prefix.isEmpty()) ? Namespace.EMPTY_NAMESPACE : Namespace.getNamespace(prefix, session.getNamespaceURI(prefix)); davPrivs.add(Privilege.getPrivilege(Text.getLocalName(privilegeName), ns)); } return new CurrentUserPrivilegeSetProperty(davPrivs.toArray(new Privilege[davPrivs.size()])); } }
/** * Tests that Session.getNamespaceURI() returns according the session scoped * mapping */ public void testGetNamespaceURI() throws RepositoryException { String testPrefix = getUnusedPrefix(); // remap the jcr uri session.setNamespacePrefix(testPrefix, NS_JCR_URI); String uri = session.getNamespaceURI(testPrefix); assertEquals("Session.getNamespaceURI does not return the correct value.", NS_JCR_URI, uri); }
@Test public void verifyNameSpaces() throws Exception { Session session = createAdminSession(); try { assertEquals( "http://www.example.org/", session.getNamespaceURI("test")); } finally { session.logout(); } }
@Test public void verifyNameSpaces() throws Exception { Session session = createAdminSession(); try { assertEquals( "http://www.example.org/", session.getNamespaceURI("test")); } finally { session.logout(); } }