code: public String[] getNamespacePrefixes() throws RepositoryException
     {
        Collection<String> allPrefixes = new LinkedList<String>();
        allPrefixes.addAll(namespaces.keySet());
  
        String[] permanentPrefixes = workspace.getNamespaceRegistry().getPrefixes();
  
        for (int i = 0; i < permanentPrefixes.length; i++)
        {
           if (!prefixes.containsKey(workspace.getNamespaceRegistry().getURI(permanentPrefixes[i])))
           {
              allPrefixes.add(permanentPrefixes[i]);
           }
        }
        return allPrefixes.toArray(new String[allPrefixes.size()]);
     }
docs: {@inheritDoc}