Namespace: ITHit.WebDAV.Server
Exception | Condition |
---|---|
LockedException | This item or its parent was locked and client did not provide lock token. |
NeedPrivilegesException | The user doesn't have enough privileges. |
InsufficientStorageException | Quota limit is reached. |
MultistatusException | Errors has occured during processing of item in the subtree and whole operation shall be aborted. |
DavException | In other cases. Possible status value is CONFLICT if destination folder doesn't exist. |
The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.
public override async Task DeleteAsync(MultistatusException multistatus) { await DeleteInternalAsync(multistatus, 0); } public override async Task DeleteInternalAsync(MultistatusException multistatus, int recursionDepth) { await RequireHasTokenAsync(); if (FileSystemInfoExtension.IsUsingFileSystemAttribute) { await fileSystemInfo.DeleteExtendedAttributes(); } fileSystemInfo.Delete(); if (recursionDepth == 0) { await context.socketService.NotifyDeletedAsync(Path, GetWebSocketID()); } }
The code below is part of 'WebDAVServer.FileSystemSynchronization.AspNetCore' C# & VB samples provided with the SDK.
public override async Task DeleteAsync(MultistatusException multistatus) { await DeleteInternalAsync(multistatus, 0); } public override async Task DeleteInternalAsync(MultistatusException multistatus, int recursionDepth) { await RequireHasTokenAsync(); if (FileSystemInfoExtension.IsUsingFileSystemAttribute) { await fileSystemInfo.DeleteExtendedAttributes(); } if (recursionDepth == 0) { // hide file, it is needed for sync-collection report. fileSystemInfo.Attributes = fileSystemInfo.Attributes | FileAttributes.Hidden; using (FileStream fileStream = new FileStream(fileSystemInfo.FullName, FileMode.Truncate)) { fileStream.SetLength(0); } await context.socketService.NotifyDeletedAsync(Path, GetWebSocketID()); } else { fileSystemInfo.Delete(); } }