String prefix = getWorkspace().getNamespaceRegistry().getPrefix(uri);
String prefix = getWorkspace().getNamespaceRegistry().getPrefix(uri);
/** * Returns the prefixes of all known namespace mappings. All global * mappings not already included in the local set of namespace mappings * are added there. * <p> * This behaviour is based on JSR 283 (JCR 2.0), but remains backwards * compatible with JCR 1.0. * * @return namespace prefixes * @throws RepositoryException if a repository error occurs */ public String[] getNamespacePrefixes() throws RepositoryException { for (String uri : getWorkspace().getNamespaceRegistry().getURIs()) { getNamespacePrefix(uri); } synchronized (namespaces) { return namespaces.keySet().toArray(new String[namespaces.size()]); } }
/** * Returns the prefixes of all known namespace mappings. All global * mappings not already included in the local set of namespace mappings * are added there. * <p> * This behaviour is based on JSR 283 (JCR 2.0), but remains backwards * compatible with JCR 1.0. * * @return namespace prefixes * @throws RepositoryException if a repository error occurs */ public String[] getNamespacePrefixes() throws RepositoryException { for (String uri : getWorkspace().getNamespaceRegistry().getURIs()) { getNamespacePrefix(uri); } synchronized (namespaces) { return namespaces.keySet().toArray(new String[namespaces.size()]); } }
String prefix = getWorkspace().getNamespaceRegistry().getPrefix(uri);
/** * Returns the prefixes of all known namespace mappings. All global * mappings not already included in the local set of namespace mappings * are added there. * <p> * This behaviour is based on JSR 283 (JCR 2.0), but remains backwards * compatible with JCR 1.0. * * @return namespace prefixes * @throws RepositoryException if a repository error occurs */ public String[] getNamespacePrefixes() throws RepositoryException { for (String uri : getWorkspace().getNamespaceRegistry().getURIs()) { getNamespacePrefix(uri); } synchronized (namespaces) { return namespaces.keySet().toArray(new String[namespaces.size()]); } }
uri = getWorkspace().getNamespaceRegistry().getURI(prefix); if (namespaces.containsValue(uri)) {
uri = getWorkspace().getNamespaceRegistry().getURI(prefix); if (namespaces.containsValue(uri)) {
uri = getWorkspace().getNamespaceRegistry().getURI(prefix); if (namespaces.containsValue(uri)) {
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }
/** * Logs in the same workspace with the given credentials. * <p> * The default implementation: * <ul> * <li>Retrieves the {@link Repository} instance using * {@link Session#getRepository()} * <li>Retrieves the current workspace using {@link Session#getWorkspace()} * <li>Retrieves the name of the current workspace using * {@link Workspace#getName()} * <li>Calls {@link Repository#login(Credentials, String)} on the * retrieved repository with the given credentials and the retrieved * workspace name. * </ul> * * @param credentials login credentials * @return logged in session * @throws RepositoryException if an error occurs */ public Session impersonate(Credentials credentials) throws RepositoryException { return getRepository().login(credentials, getWorkspace().getName()); }