nsAutoString		leaf(leafUni); Recycle(leafUni); leafUni = nsnull;    PRInt32			aOffset; while ((aOffset = leaf.FindChar(' ')) >= 0) { leaf.Cut(aOffset, 1); leaf.InsertWithConversion("%20", aOffset); } while ((aOffset = leaf.FindChar('/')) >= 0) { leaf.Cut(aOffset, 1); leaf.InsertWithConversion("%2F", aOffset); }   fullURI.Append(leaf);  PRBool			dirFlag = PR_FALSE; if (NS_FAILED(rv = aFile->IsDirectory(&dirFlag))) break; if (dirFlag == PR_TRUE) {    }  nsCOMPtr<nsIRDFResource>	fileRes; gRDFService->GetUnicodeResource(fullURI.GetUnicode(), getter_AddRefs(fileRes));  nameArray->AppendElement(fileRes);  if (onlyFirst == PR_TRUE)	break;
FileSystemDataSource::GetFolderList(nsIRDFResource *source, PRBool allowHidden, nsISimpleEnumerator** aResult){	nsresult	rv;	nsCOMPtr<nsISupportsArray> nameArray;	rv = NS_NewISupportsArray(getter_AddRefs(nameArray));	if (NS_FAILED(rv)) return rv;	const char		*uri;	rv = source->GetValueConst(&uri);	if (NS_FAILED(rv)) return(rv);	nsFileURL 		parentDir(uri);	nsNativeFileSpec 	nativeDir(parentDir);	for (nsDirectoryIterator i(nativeDir, PR_FALSE); i.Exists(); i++)	{		const nsNativeFileSpec	nativeSpec = (const nsNativeFileSpec &)i;		if (allowHidden == PR_FALSE)		{			if (!isVisible(nativeSpec))	continue;		}		nsFileURL		fileURL(nativeSpec);		const char		*childURL = fileURL.GetAsString();		if (childURL != nsnull)		{			nsCOMPtr<nsIRDFResource> file;			gRDFService->GetResource(childURL, getter_AddRefs(file));			nameArray->AppendElement(file);		}	}	nsISimpleEnumerator* result = new nsArrayEnumerator(nameArray);	if (! result)		return NS_ERROR_OUT_OF_MEMORY;	NS_ADDREF(result);	*aResult = result;	return NS_OK;}