Click or drag to resize

IFolderAsyncCreateFolderAsync Method

IT Hit WebDAV Classes Reference
Creates new WebDAV folder with the specified name in this folder.

Namespace:  ITHit.WebDAV.Server.Class1
Assembly:  ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 11.3.10719
Syntax
Task CreateFolderAsync(
	string name
)

Task CreateFolderAsync(
	string name
)

Parameters

name
Type: SystemString
Name of the folder to create.

Return Value

Type: Task
.
Exceptions
ExceptionCondition
LockedExceptionThis folder was locked. Client did not provide the lock token.
NeedPrivilegesExceptionThe user doesn't have enough privileges.
InsufficientStorageExceptionQuota limit is reached.
DavExceptionIn other cases.
Examples

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

virtual public async Task CreateFolderAsync(string name)
{
    await RequireHasTokenAsync();

    bool isRoot = dirInfo.Parent == null;
    DirectoryInfo di = isRoot ? new DirectoryInfo(@"\\?\" + context.RepositoryPath.TrimEnd(System.IO.Path.DirectorySeparatorChar)) : dirInfo;
    di.CreateSubdirectory(name);
    await context.socketService.NotifyCreatedAsync(System.IO.Path.Combine(Path, name));
}
See Also