Closed Bug 36972 Opened 24 years ago Closed 23 years ago

RDF should use nsIFile

Categories

(Core Graveyard :: RDF, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: dougt, Assigned: waterson)

References

Details

(Whiteboard: [NEED INFO])

Attachments

(1 file)

RDF should use nsIFile.  nsFileSpec is unsupported.

There are a few places that RDF uses nsFileSpec.  these should be converted.
i'll do this after nsbeta2, unless there is need to do it earlier...
Status: NEW → ASSIGNED
Target Milestone: --- → M18
[NEED INFO] radar.
Whiteboard: [NEED INFO]
Target Milestone: M18 → Future
Depends on: 78013
From Darin:  (re: nsFileSpec usage nsLocalStore.cpp)

Take a look at NS_NewLocalFileInputStream and NS_NewLocalFileOutputStream in
nsIFileStreams.idl.  you might also want to wrap the output stream in a buffered
output stream (see NS_NewBufferedOutputStream).
Get nsFileSpec out of nsLocalStore.cpp using Darin's suggested changes.
Comment on attachment 65358 [details] [diff] [review]
Get nsFileSpec out of nsLocalStore.cpp

>Index: mozilla/rdf/datasource/src/nsLocalStore.cpp

>+    nsXPIDLCString pathBuf;
>+    rv = aURI->GetSpec(getter_Copies(pathBuf));
>     if (NS_FAILED(rv)) return rv;

this patch looks great to me, but for my sanity could |pathBuf| be renamed
|specBuf| or just |spec|?

sr=darin
Attachment #65358 - Flags: superreview+
Blocks: 113894
Comment on attachment 65358 [details] [diff] [review]
Get nsFileSpec out of nsLocalStore.cpp

>-        if (! spec.Exists())
>+        if (NS_SUCCEEDED(rv = aFile->Exists(&fileExistsFlag)) && (!fileExistsFlag))
>             return NS_ERROR_UNEXPECTED;

How about breaking this up:

  fileExistsFlag = PR_FALSE;
  aFile->Exists(&fileExistsFlag);
  if (! fileExistsFlag)
    return NS_ERROR_FAILURE;

(Is this really even necessary? What if we just let the local store get
created even though we can't write it? Failing here will lead to a trickle-
down failure and nothing will work...why not just fail when we try to write
it back?)

The rest looks fine, r=waterson.
Attachment #65358 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
tever is not RDF QA anymore
QA Contact: tever → nobody
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: