Ejemplo n.º 1
0
    protected override HttpStatusCode ProcessRequestInternal(HttpContext context)
    {
        // try to find the resource and return the appropriate response if there is one
        var res = context.TryGetResource();

        if (res != null)
        {
            return(HttpStatusCode.MethodNotAllowed);
        }

        // we don't support creations of collections
        throw WebDAVException.ResourceCollectionsImmutable();
    }
Ejemplo n.º 2
0
    private static VivendiDocument?TryGetDocumentInternal(HttpContext context, Uri uri, out VivendiCollection parentCollection, out string name)
    {
        // try to get the resource
        var res = TryGetResourceInternal(context, uri, out parentCollection, out name, out var isCollection);

        if (res == null)
        {
            // if the URI ends with a slash also treat it as a collection
            if (isCollection)
            {
                throw WebDAVException.ResourceCollectionsImmutable();
            }
            return(null);
        }

        // ensure the value is a document
        return(res as VivendiDocument ?? throw WebDAVException.ResourceCollectionsImmutable());
    }
Ejemplo n.º 3
0
 private static VivendiDocument GetDocumentInternal(HttpContext context, Uri uri) => GetResourceInternal(context, uri) as VivendiDocument ?? throw WebDAVException.ResourceCollectionsImmutable();