Click or drag to resize

IQuotaGetUsedBytesAsync Method

IT Hit WebDAV Classes Reference
Value in bytes representing the amount of space used by this folder/file and possibly a number of other similar folders/files, where the set of "similar" meets at least the criterion that allocating space to any folder/file in the set will count against the GetAvailableBytesAsync. It MUST include the total count including usage derived from sub-items if appropriate. It SHOULD include metadata storage size if metadata storage is counted against the GetAvailableBytesAsync

Namespace:  ITHit.WebDAV.Server.Quota
Assembly:  ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 13.3.13068
Syntax
Task<long> GetUsedBytesAsync()

Return Value

Type: TaskInt64
Bytes occupied by folder/file.
Exceptions
ExceptionCondition
NeedPrivilegesExceptionThe user doesn't have enough privileges.
DavExceptionIn other cases.
Examples

The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.

public async Task<long> GetUsedBytesAsync()
{
    // Here you can return amount of bytes used by current user.
    // For the sake of simplicity we return entire used disk space.

    //Note: NTFS quotes retrieval for current user works very slowly.

    return await dirInfo.GetStorageUsedBytesAsync();
}
See Also