("rdfxml[%p] flush(%s)", this, mURLSpec));
("rdfxml[%p] flush(%s)", this, mOriginalURLSpec.get()));
RDFXMLDataSourceImpl::Flush(void){    if (!mIsWritable || !mIsDirty)        return NS_OK;    NS_PRECONDITION(mURLSpec != nsnull, "not initialized");    if (! mURLSpec)        return NS_ERROR_NOT_INITIALIZED;    PR_LOG(gLog, PR_LOG_ALWAYS,           ("rdfxml[%p] flush(%s)", this, mURLSpec));    nsresult rv;    {        // Quick and dirty check to see if we're in XPCOM shutdown. If        // we are, we're screwed: it's too late to serialize because        // many of the services that we'll need to acquire to properly        // write the file will be unaquirable.        nsCOMPtr<nsIRDFService> dummy = do_GetService(kRDFServiceCID, &rv);        if (NS_FAILED(rv)) {            NS_WARNING("unable to Flush() diry datasource during XPCOM shutdown");            return rv;        }    }    // XXX Replace this with channels someday soon...    nsFileURL url(mURLSpec, PR_TRUE);    nsFileSpec path(url);    nsOutputFileStream out(path);    if (! out.is_open())        return NS_ERROR_FAILURE;    nsCOMPtr<nsIOutputStream> outIStream = out.GetIStream();    if (NS_FAILED(rv = Serialize(outIStream)))        goto done;    mIsDirty = PR_FALSE;done:    return NS_OK;}