DavContextBaseAsyncGetHierarchyItemAsync Method
IT Hit WebDAV Classes Reference
Implementation of this abstract method is used by WebDAV engine to find hierarchy item objects by path.
Namespace:
ITHit.WebDAV.Server
Assembly:
ITHit.WebDAV.Server (in ITHit.WebDAV.Server.dll) Version: 7.1.4620
Syntax public abstract Task<IHierarchyItemAsync> GetHierarchyItemAsync(
string path
)
Public MustOverride Function GetHierarchyItemAsync (
path As String
) As Task(Of IHierarchyItemAsync)
public:
virtual Task<IHierarchyItemAsync^>^ GetHierarchyItemAsync(
String^ path
) abstract
abstract GetHierarchyItemAsync :
path : string -> Task<IHierarchyItemAsync>
Parameters
- path
- Type: SystemString
Path of the hierarchy item object.
It is always the full path from the root of the WebDAV repository.
Return Value
Type:
TaskIHierarchyItemAsync
Hierarchy item object referenced by the specified path or
null
if hierarchy item not found.
Remarks
When you inherit from the WebDAV Context class, you must override this abstract method.
For WebDAV Class 1 and Class 2 server in this method implementation you will search for file or folder in
your storage by path provided and return it to WebDAV engine.
For DeltaV server in addition to folder or file item you will return version and history items.
Examples The code below is part of 'WebDAVServer.FileSystemStorage.AspNet' C# & VB samples provided with the SDK.
public override async Task<IHierarchyItemAsync> GetHierarchyItemAsync(string path)
{
path = path.Trim(new[] { ' ', '/' });
int ind = path.IndexOf('?');
if (ind > -1)
{
path = path.Remove(ind);
}
IHierarchyItemAsync item = null;
item = await DavFolder.GetFolderAsync(this, path);
if (item != null)
return item;
item = await DavFile.GetFileAsync(this, path);
if (item != null)
return item;
Logger.LogDebug("Could not find item that corresponds to path: " + path);
return null;
}
Public Overrides Async Function GetHierarchyItemAsync(path As String) As Task(Of IHierarchyItemAsync)
path = path.Trim({" "c, "/"c})
Dim ind As Integer = path.IndexOf("?"c)
If ind > -1 Then
path = path.Remove(ind)
End If
Dim item As IHierarchyItemAsync = Nothing
item = Await DavFolder.GetFolderAsync(Me, path)
If item IsNot Nothing Then Return item
item = Await DavFile.GetFileAsync(Me, path)
If item IsNot Nothing Then Return item
Logger.LogDebug("Could not find item that corresponds to path: " & path)
Return Nothing
End Function
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also