Prefix is assumed to be part of the collection name.
This also has an issue where items in /irods/home/account/dir1 will br
returned if /irods/home/account/dir is asked for (ie, spaceId=dir)

@param spaceId
@param prefix
@return
354558
@Override
    public Iterator<String> getSpaceContents(String spaceId, String prefix) {
        ConnectOperation co =
            new ConnectOperation(host, port, username, password, zone);

        String path;
        if (prefix != null && !prefix.equals("")) {
            path = baseDirectory + "/" + spaceId + "/" + prefix;
        } else {
            path = baseDirectory + "/" + spaceId;
        }

        log.trace("listing space contents for " + path);
        try {
            return listRecursiveFiles(path, co.getConnection());
        } catch (IOException e) {
            log.error("Could not connect to iRODS", e);
            throw new StorageException(e);
        }
    }
377683
public static String add(String prefix, String name) {
    return (prefix == null) ? name : prefix+"."+name;
  }
1337617
protected boolean popNamespace(String prefix)
    {
        try
        {
            if (m_prefixMap.popNamespace(prefix))
            {
                m_saxHandler.endPrefixMapping(prefix);
                return true;
            }
        }
        catch (SAXException e)
        {
            // falls through
        }
        return false;
    }
1170998
public List<String> prefixMatch(String prefix)
    {
        int curState = 1;
        IntArrayList bytes = new IntArrayList(prefix.length() * 4);
        for (int i = 0; i < prefix.length(); i++)
        {
            int codePoint = prefix.charAt(i);
            if (curState < 1)
            {
                return Collections.emptyList();
            }
            if ((curState != 1) && (isEmpty(curState)))
            {
                return Collections.emptyList();
            }
            int[] ids = this.charMap.toIdList(codePoint);
            if (ids.length == 0)
            {
                return Collections.emptyList();
            }
            for (int j = 0; j < ids.length; j++)
            {
                int c = ids[j];
                if ((getBase(curState) + c < getBaseArraySize())
                    && (getCheck(getBase(curState) + c) == curState))
                {
                    bytes.append(c);
                    curState = getBase(curState) + c;
                }
                else
                {
                    return Collections.emptyList();
                }
            }

        }
        List<String> result = new ArrayList<String>();
        recursiveAddSubTree(curState, result, bytes);

        return result;
    }
89471
private static File getUserDirectory(final String prefix, final String suffix, final File parent) {
        final String dirname = formatDirName(prefix, suffix);
        return new File(parent, dirname);
    }
1248455
protected String lookupNamespaceURIImpl(String name) {
        String prefix = getPrefixFromQualifiedName(name);
        String namespaceURI = this.xmlNode.lookupNamespaceURI(prefix);
        return namespaceURI;
    }
1005692
public void setNamespace(String prefix, String namespaceURI) {
    ensureNotNull("Prefix", prefix);
    ensureNotNull("Namespace URI", namespaceURI);

    namespaces.put(prefix, namespaceURI);
  }
648542
public List<Space> getSpaces(int orgId) {
		return getResourceFactory().getApiResource("/org/" + orgId + "/space/")
				.get(new GenericType<List<Space>>() {
				});
	}
338525
protected boolean pushNamespace(String prefix, String uri)
    {
        try
        {
            if (m_prefixMap.pushNamespace(
                prefix, uri, m_elemContext.m_currentElemDepth))
            {
                startPrefixMapping(prefix, uri);
                return true;
            }
        }
        catch (SAXException e)
        {
            // falls through
        }
        return false;
    }
821752
public static String createNewBucketName(String accessKeyId,
                                             String spaceId) {
        String bucketName = accessKeyId + "." + spaceId;
        bucketName = bucketName.toLowerCase();
        bucketName = bucketName.replaceAll("[^a-z0-9-.]", "-");

        // Remove duplicate separators (. and -)
        while (bucketName.contains("--") || bucketName.contains("..")
               || bucketName.contains("-.") || bucketName.contains(".-")) {
            bucketName = bucketName.replaceAll("[-]+", "-");
            bucketName = bucketName.replaceAll("[.]+", ".");
            bucketName = bucketName.replaceAll("-[.]", "-");
            bucketName = bucketName.replaceAll("[.]-", ".");
        }

        if (bucketName.length() > 63) {
            bucketName = bucketName.substring(0, 63);
        }
        while (bucketName.endsWith("-") || bucketName.endsWith(".")) {
            bucketName = bucketName.substring(0, bucketName.length() - 1);
        }
        return bucketName;
    }
1124285
public String getSpaceContents(String spaceID,
                                   String storeID,
                                   String prefix,
                                   long maxResults,
                                   String marker) throws ResourceException {
        Element spaceElem = new Element("space");
        spaceElem.setAttribute("id", spaceID);

        try {
            StorageProvider storage = storageProviderFactory.getStorageProvider(storeID);

            List<String> contents = storage.getSpaceContentsChunked(spaceID,
                                                                    prefix,
                                                                    maxResults,
                                                                    marker);
            if (contents != null) {
                for (String contentItem : contents) {
                    Element contentElem = new Element("item");
                    contentElem.setText(contentItem);
                    spaceElem.addContent(contentElem);
                }
            }
        } catch (NotFoundException e) {
            throw new ResourceNotFoundException("build space XML for", spaceID, e);
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("build space XML for", spaceID, e);
        }

        Document doc = new Document(spaceElem);
        XMLOutputter xmlConverter = new XMLOutputter();
        return xmlConverter.outputString(doc);
    }
950027
def LookupNamespace(self, prefix):
        
        ret = libxml2mod.xmlTextReaderLookupNamespace(self._o, prefix)
        return ret
445921
protected long doCount(String spaceId) throws IOException {
        TopDocs result = getIndexSearcher().search(buildQuery(spaceId, null), 1);
        return result != null ? result.totalHits : -1;
    }
385002
public void removeNamespace( String prefix, String elementName ) {
      if( prefix == null ){
         prefix = "";
      }
      if( StringUtils.isBlank( elementName ) ){
         rootNamespace.remove( prefix.trim() );
      }else{
         Map nameSpaces = (Map) namespacesPerElement.get( elementName );
         nameSpaces.remove( prefix );
      }
   }
802664
public boolean containsKeyPrefix(String prefix) {
        if (prefix == null) {
            throw new NullPointerException("Prefix key can not be null");
        }

        // An empty string is a prefix of everything
        if (prefix.equals("")) {
            return true;
        }

        // Find nearest node
        PatriciaNode<V> nearest = findNearestNode(prefix);

        // If no nearest node exist, there isn't any prefix match either
        if (nearest == null) {
            return false;
        }

        // The nearest is the root, so no match
        if (nearest.getKey() == null) {
            return false;
        }

        // Test prefix match
        return nearest.getKey().startsWith(prefix);
    }
254186
public static NamespaceContext
        toNamespaceContext(Map<String, String> prefix2URI) {
        final Map<String, String> copy =
            new LinkedHashMap<String, String>(prefix2URI);
        return new NamespaceContext() {
            public String getNamespaceURI(String prefix) {
                if (prefix == null) {
                    throw new IllegalArgumentException("prefix must not be null");
                }
                if (XMLConstants.XML_NS_PREFIX.equals(prefix)) {
                    return XMLConstants.XML_NS_URI;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE.equals(prefix)) {
                    return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
                }
                String uri = copy.get(prefix);
                return uri != null ? uri : XMLConstants.NULL_NS_URI;
            }

            public String getPrefix(String uri) {
                Iterator i = getPrefixes(uri);
                return i.hasNext() ? (String) i.next() : null;
            }

            public Iterator getPrefixes(String uri) {
                if (uri == null) {
                    throw new IllegalArgumentException("uri must not be null");
                }
                Collection<String> c = new LinkedHashSet<String>();
                boolean done = false;
                if (XMLConstants.XML_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XML_NS_PREFIX);
                    done = true;
                }
                if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(uri)) {
                    c.add(XMLConstants.XMLNS_ATTRIBUTE);
                    done = true;
                }
                if (!done) {
                    for (Map.Entry<String, String> entry : copy.entrySet()) {
                        if (uri.equals(entry.getValue())) {
                            c.add(entry.getKey());
                        }
                    }
                }
                return c.iterator();
            }
        };
    }
1200890
@Override
    public final String getNamespaceURI(String prefix)
    {
        if (prefix == null) {
            throw new IllegalArgumentException(ErrorConsts.ERR_NULL_ARG);
        }
        if (prefix.length() == 0) {
            if (mDepth == 0) { // unexpected... but let's not err at this point
                /* 07-Sep-2007, TSa: Default/"no namespace" does map to
                 *    "URI" of empty String.
                 */
                return XmlConsts.DEFAULT_NAMESPACE_URI;
            }
            return mCurrElement.mDefaultNsURI;
        }
        if (prefix.equals(XMLConstants.XML_NS_PREFIX)) {
            return XMLConstants.XML_NS_URI;
        }
        if (prefix.equals(XMLConstants.XMLNS_ATTRIBUTE)) {
            return XMLConstants.XMLNS_ATTRIBUTE_NS_URI;
        }
        /* Ok, need to find the match, if any; starting from end of the
         * list of active namespaces. Note that we can not count on prefix
         * being interned/canonicalized.
         */
        return mNamespaces.findLastNonInterned(prefix);
    }