Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes
nsWebDAVService Class Reference
Inheritance diagram for nsWebDAVService:
Inheritance graph
[legend]
Collaboration diagram for nsWebDAVService:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_NSIWEBDAVSERVICE 
nsWebDAVService ()
virtual ~nsWebDAVService ()
void lockResources (in PRUint32 count,[array, size_is(count)] in nsIWebDAVResource resources, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void unlockResources (in PRUint32 count,[array, size_is(count)] in nsIWebDAVResource resources, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void getResourcePropertyNames (in nsIWebDAVResource resource, in boolean withDepth, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void getResourceProperties (in nsIWebDAVResource resource, in PRUint32 propCount,[array, size_is(propCount)] in string properties, in boolean withDepth, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void getResourceOptions (in nsIWebDAVResource resource, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void get (in nsIWebDAVResource resource, in nsIStreamListener listener, in nsIInterfaceRequestor notificationCallbacks)
void getToOutputStream (in nsIWebDAVResource resource, in nsIOutputStream stream, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
 GET the resource and stick it in the provided OutputStream.
void getToString (in nsIWebDAVResource resource, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
 GET the resource and return it to the listener as a string.
void put (in nsIWebDAVResource resource, in ACString contentType, in nsIInputStream data, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void putFromString (in nsIWebDAVResource resource, in ACString contentType, in AUTF8String data, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void remove (in nsIWebDAVResource resource, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void moveTo (in nsIWebDAVResource resource, in ACString destination, in boolean overwrite, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void copyTo (in nsIWebDAVResource resource, in ACString destination, in boolean recursive, in boolean overwrite, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void makeCollection (in nsIWebDAVResource resource, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
void report (in nsIWebDAVResource resource, in nsIDOMDocument query, in boolean withDepth, in nsIWebDAVOperationListener listener, in nsIInterfaceRequestor notificationCallbacks, in nsISupports closure)
 Requests the specified report on the given resource with a Depth: header set to zero.

Protected Member Functions

nsresult EnsureIOService ()
nsresult ChannelFromResource (nsIWebDAVResource *resource, nsIInterfaceRequestor *notificationCallbacks, nsIHttpChannel **channel, nsIURI **resourceURI=0)
nsresult CreatePropfindDocument (nsIURI *resourceURI, nsIDOMDocument **requestDoc, nsIDOMElement **propfindElt)
nsresult PropfindInternal (nsIWebDAVResource *resource, PRUint32 propCount, const char **properties, PRBool withDepth, nsIWebDAVOperationListener *listener, nsIInterfaceRequestor *notificationCallbacks, nsISupports *closure, PRBool namesOnly)
nsresult SendDocumentToChannel (nsIDocument *doc, nsIHttpChannel *channel, const char *const method, nsIStreamListener *listener, PRBool withDepth)

Protected Attributes

nsCOMPtr< nsIIOServicemIOService
nsAutoString mDAVNSString

Detailed Description

Definition at line 72 of file nsWebDAVService.cpp.


Constructor & Destructor Documentation

Definition at line 303 of file nsWebDAVService.cpp.

                                 :
    mDAVNSString(NS_LITERAL_STRING("DAV:"))

{
#ifdef PR_LOGGING
    gDAVLog = PR_NewLogModule("webdav");
#endif
}

Definition at line 312 of file nsWebDAVService.cpp.

{
  /* destructor code */
}

Member Function Documentation

nsresult nsWebDAVService::ChannelFromResource ( nsIWebDAVResource resource,
nsIInterfaceRequestor notificationCallbacks,
nsIHttpChannel **  channel,
nsIURI **  resourceURI = 0 
) [protected]

Definition at line 264 of file nsWebDAVService.cpp.

{
    ENSURE_IO_SERVICE();

    nsCOMPtr<nsIURL> resourceURL;

    nsresult rv = aResource->GetResourceURL(getter_AddRefs(resourceURL));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIChannel> baseChannel;
    rv = mIOService->NewChannelFromURI(resourceURL, getter_AddRefs(baseChannel));
    NS_ENSURE_SUCCESS(rv, rv);

    rv = baseChannel->SetNotificationCallbacks(notificationCallbacks);
    NS_ENSURE_SUCCESS(rv, rv);

    nsLoadFlags loadFlags;
    rv = baseChannel->GetLoadFlags(&loadFlags);
    if (NS_SUCCEEDED(rv)) {
        rv = baseChannel->SetLoadFlags(loadFlags | 
                                       nsIRequest::VALIDATE_ALWAYS);
        NS_ASSERTION(NS_SUCCEEDED(rv),
                     "nsWebDavService::ChannelFromResource(): "
                     "Couldn't set loadflags on channel");
    }

    rv = CallQueryInterface(baseChannel, aChannel);

    if (NS_SUCCEEDED(rv) && aResourceURI) {
        *aResourceURI = resourceURL.get();
        NS_ADDREF(*aResourceURI);
    }

    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIWebDAVService::copyTo ( in nsIWebDAVResource  resource,
in ACString  destination,
in boolean  recursive,
in boolean  overwrite,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
nsresult nsWebDAVService::CreatePropfindDocument ( nsIURI resourceURI,
nsIDOMDocument **  requestDoc,
nsIDOMElement **  propfindElt 
) [protected]

Definition at line 223 of file nsWebDAVService.cpp.

{
    nsresult rv;
    static NS_DEFINE_CID(kDOMDOMDOMDOMImplementationCID,
                         NS_DOM_IMPLEMENTATION_CID);
    nsCOMPtr<nsIDOMDOMImplementation>
        implementation(do_CreateInstance(kDOMDOMDOMDOMImplementationCID, &rv));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIPrivateDOMImplementation> 
        privImpl(do_QueryInterface(implementation));
    privImpl->Init(resourceURI);

    nsCOMPtr<nsIDOMDocument> doc;
    rv = implementation->CreateDocument(mDAVNSString, EmptyString(), nsnull,
                                        getter_AddRefs(doc));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIDocument> baseDoc = do_QueryInterface(doc);
    baseDoc->SetXMLDeclaration(NS_LITERAL_STRING("1.0").get(),
                               EmptyString().get(), -1);
    baseDoc->SetDocumentURI(resourceURI);

    nsCOMPtr<nsIDOMElement> elt;
    rv = NS_WD_AppendElementWithNS(doc, doc, mDAVNSString,
                                   NS_LITERAL_STRING("propfind"),
                                   getter_AddRefs(elt));
    elt->SetPrefix(NS_LITERAL_STRING("D"));
    NS_ENSURE_SUCCESS(rv, rv);

    *requestDoc = doc.get();
    NS_ADDREF(*requestDoc);
    *propfindElt = elt.get();
    NS_ADDREF(*propfindElt);

    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 114 of file nsWebDAVService.cpp.

{
    if (!mIOService) {
        nsresult rv;
        mIOService = do_GetIOService(&rv);
        if (!mIOService)
            return rv;
    }

    return NS_OK;
}

Here is the call graph for this function:

void nsIWebDAVService::get ( in nsIWebDAVResource  resource,
in nsIStreamListener  listener,
in nsIInterfaceRequestor  notificationCallbacks 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt. XXX need to add a closure param

void nsIWebDAVService::getResourceOptions ( in nsIWebDAVResource  resource,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::getResourceProperties ( in nsIWebDAVResource  resource,
in PRUint32  propCount,
[array, size_is(propCount)] in string  properties,
in boolean  withDepth,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
propertiesan array of propertynames, where the namespace and the name of the properties are seperated by a space
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::getResourcePropertyNames ( in nsIWebDAVResource  resource,
in boolean  withDepth,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::getToOutputStream ( in nsIWebDAVResource  resource,
in nsIOutputStream  stream,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]

GET the resource and stick it in the provided OutputStream.

Your output stream must be buffered, or we will fail miserably. I would check that for you and provide a buffered wrapper automatically, but there is no way to check if one is needed!

Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::getToString ( in nsIWebDAVResource  resource,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]

GET the resource and return it to the listener as a string.

Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::lockResources ( in PRUint32  count,
[array, size_is(count)] in nsIWebDAVResource  resources,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::makeCollection ( in nsIWebDAVResource  resource,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::moveTo ( in nsIWebDAVResource  resource,
in ACString  destination,
in boolean  overwrite,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
nsresult nsWebDAVService::PropfindInternal ( nsIWebDAVResource resource,
PRUint32  propCount,
const char **  properties,
PRBool  withDepth,
nsIWebDAVOperationListener listener,
nsIInterfaceRequestor notificationCallbacks,
nsISupports *  closure,
PRBool  namesOnly 
) [protected]

Definition at line 360 of file nsWebDAVService.cpp.

{
    nsresult rv;

    NS_ENSURE_ARG(resource);
    NS_ENSURE_ARG(listener);

    nsCOMPtr<nsIURI> resourceURI;
    nsCOMPtr<nsIHttpChannel> channel;
    rv = ChannelFromResource(resource, notificationCallbacks, getter_AddRefs(channel),
                             getter_AddRefs(resourceURI));
    if (NS_FAILED(rv))
        return rv;

    nsCOMPtr<nsIDOMDocument> requestDoc;
    nsCOMPtr<nsIDOMElement> propfindElt;
    rv = CreatePropfindDocument(resourceURI, getter_AddRefs(requestDoc),
                                getter_AddRefs(propfindElt));
    NS_ENSURE_SUCCESS(rv, rv);

    if (namesOnly) {
        nsCOMPtr<nsIDOMElement> allpropElt;
        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,
                                       mDAVNSString, NS_LITERAL_STRING("propname"),
                                       getter_AddRefs(allpropElt));
        NS_ENSURE_SUCCESS(rv, rv);
    } else if (propCount == 0) {
        nsCOMPtr<nsIDOMElement> allpropElt;
        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,
                                       mDAVNSString, NS_LITERAL_STRING("allprop"),
                                       getter_AddRefs(allpropElt));
        NS_ENSURE_SUCCESS(rv, rv);
    } else {
        nsCOMPtr<nsIDOMElement> propElt;
        rv = NS_WD_AppendElementWithNS(requestDoc, propfindElt,
                                       mDAVNSString, NS_LITERAL_STRING("prop"),
                                       getter_AddRefs(propElt));
        NS_ENSURE_SUCCESS(rv, rv);

        for (PRUint32 i = 0; i < propCount; i++) {
            nsDependentCString fullpropName(properties[i]);

            // This string math is _ridiculous_.  It better compile to a total of
            // 5 instructions, or I'm ripping it all out and doing my own looping.

            nsACString::const_iterator start, saveStart, end, saveEnd;
            fullpropName.BeginReading(start);
            fullpropName.BeginReading(saveStart);
            fullpropName.EndReading(end);
            fullpropName.EndReading(saveEnd);
            RFindInReadable(NS_LITERAL_CSTRING(" "), start, end);

            if (start == end) {
                nsCAutoString msg(NS_LITERAL_CSTRING("Illegal property name ")
                                  + fullpropName + NS_LITERAL_CSTRING("\n"));
                NS_WARNING(msg.get());
                return NS_ERROR_INVALID_ARG;
            }

#ifdef PR_LOGGING
            if (LOG_ENABLED()) {
                nsACString::const_iterator s = start;
                
                nsCAutoString propNamespace(nsDependentCSubstring(saveStart, s));
                nsCAutoString propName(nsDependentCSubstring(++s, saveEnd));
                
                LOG(("prop ns: '%s', name: '%s'", propNamespace.get(), propName.get()));
            }
#endif

            NS_ConvertASCIItoUTF16 propNamespace(nsDependentCSubstring(saveStart, start)),
                propName(nsDependentCSubstring(++start, saveEnd));

            nsCOMPtr<nsIDOMElement> junk;
            rv = NS_WD_AppendElementWithNS(requestDoc, propElt, propNamespace,
                                           propName, getter_AddRefs(junk));
            NS_ENSURE_SUCCESS(rv, rv);
        }
    }

    nsCOMPtr<nsIStreamListener> streamListener = 
        NS_WD_NewPropfindStreamListener(resource, listener, closure,
                                        namesOnly);

    if (!streamListener)
        return NS_ERROR_OUT_OF_MEMORY;
    
    nsCOMPtr<nsIDocument> requestBaseDoc = do_QueryInterface(requestDoc);
    return SendDocumentToChannel(requestBaseDoc, channel, "PROPFIND",
                                 streamListener, withDepth);
}

Here is the call graph for this function:

void nsIWebDAVService::put ( in nsIWebDAVResource  resource,
in ACString  contentType,
in nsIInputStream  data,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::putFromString ( in nsIWebDAVResource  resource,
in ACString  contentType,
in AUTF8String  data,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::remove ( in nsIWebDAVResource  resource,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
void nsIWebDAVService::report ( in nsIWebDAVResource  resource,
in nsIDOMDocument  query,
in boolean  withDepth,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]

Requests the specified report on the given resource with a Depth: header set to zero.

Parameters:
resourcethe resource to perform this query on?
queryan XML document of the query
withDepthif true, set the Depth header to 1 instead of 0
listenerresults will be called back through this interface
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener
nsresult nsWebDAVService::SendDocumentToChannel ( nsIDocument doc,
nsIHttpChannel channel,
const char *const  method,
nsIStreamListener listener,
PRBool  withDepth 
) [protected]

Definition at line 127 of file nsWebDAVService.cpp.

{
    nsCOMPtr<nsIStorageStream> storageStream;
    // Why do I have to pick values for these?  I just want to store some data
    // for stream access!  (And how would script set these?)
    nsresult rv = NS_NewStorageStream(4096, PR_UINT32_MAX,
                                      getter_AddRefs(storageStream));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIOutputStream> storageOutputStream;
    rv = storageStream->GetOutputStream(0,
                                        getter_AddRefs(storageOutputStream));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIDocumentEncoder> encoder =
        do_CreateInstance(NS_DOC_ENCODER_CONTRACTID_BASE "text/xml", &rv);
    NS_ENSURE_SUCCESS(rv, rv);
    
    rv = encoder->Init(doc, NS_LITERAL_STRING("text/xml"),
                       nsIDocumentEncoder::OutputEncodeBasicEntities);
    NS_ENSURE_SUCCESS(rv, rv);

    encoder->SetCharset(NS_LITERAL_CSTRING("UTF-8"));
    rv =  encoder->EncodeToStream(storageOutputStream);
    NS_ENSURE_SUCCESS(rv, rv);

    storageOutputStream->Close();

    // You gotta really want it.
#ifdef PR_LOGGING
    if (PR_LOG_TEST(gDAVLog, 5)) {
        nsCOMPtr<nsIInputStream> logInputStream;
        rv = storageStream->NewInputStream(0, getter_AddRefs(logInputStream));
        NS_ENSURE_SUCCESS(rv, rv);

        PRUint32 len, read;
        logInputStream->Available(&len);

        char *buf = new char[len+1];
        memset(buf, 0, len+1);
        logInputStream->Read(buf, len, &read);
        NS_ASSERTION(len == read, "short read on closed storage stream?");
        LOG(("XML:\n\n%*s\n\n", len, buf));
        
        delete [] buf;
    }
#endif

    nsCOMPtr<nsIInputStream> inputStream;
    rv = storageStream->NewInputStream(0, getter_AddRefs(inputStream));
    NS_ENSURE_SUCCESS(rv, rv);

    nsCOMPtr<nsIUploadChannel> uploadChannel = do_QueryInterface(channel, &rv);
    NS_ENSURE_SUCCESS(rv, rv);
    rv = uploadChannel->SetUploadStream(inputStream,
                                        NS_LITERAL_CSTRING("text/xml"), -1);
    NS_ENSURE_SUCCESS(rv, rv);
    
    channel->SetRequestMethod(nsDependentCString(method));
    channel->SetRequestHeader(NS_LITERAL_CSTRING("Content-Type"),
                              NS_LITERAL_CSTRING("text/xml; charset=utf-8"),
                              PR_FALSE);
    channel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
                              NS_LITERAL_CSTRING("text/xml"),
                              PR_FALSE);
    channel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Charset"),
                              NS_LITERAL_CSTRING("utf-8,*;q=0.1"),
                              PR_FALSE);
    

    if (withDepth) {
        channel->SetRequestHeader(NS_LITERAL_CSTRING("Depth"),
                                  NS_LITERAL_CSTRING("1"), PR_FALSE);
    } else {
        channel->SetRequestHeader(NS_LITERAL_CSTRING("Depth"),
                                  NS_LITERAL_CSTRING("0"), PR_FALSE);
    }

#ifdef PR_LOGGING
    if (LOG_ENABLED()) {
        nsCOMPtr<nsIURI> uri;
        channel->GetURI(getter_AddRefs(uri));
        nsCAutoString spec;
        uri->GetSpec(spec);
        LOG(("%s starting for %s", method, spec.get()));
    }
#endif

    return channel->AsyncOpen(listener, channel);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIWebDAVService::unlockResources ( in PRUint32  count,
[array, size_is(count)] in nsIWebDAVResource  resources,
in nsIWebDAVOperationListener  listener,
in nsIInterfaceRequestor  notificationCallbacks,
in nsISupports  closure 
) [inherited]
Parameters:
notificationCallbacksThe notification callbacks to be passed to the channel that will be used to perform this opperation. This is set by clients, who wish to provide a means to receive progress, status and protocol-specific notifications.

Interfaces commonly requested include: nsIProgressEventSink, nsIPrompt, and nsIAuthPrompt.

Parameters:
closurecaller-private data returned via listener

Member Data Documentation

Definition at line 102 of file nsWebDAVService.cpp.

Definition at line 101 of file nsWebDAVService.cpp.


The documentation for this class was generated from the following file: