ReadOnlyFileSystemProvider.GetChild Method
Namespace: Rebex.IO.FileSystem
Assembly: Rebex.FileSystem.dll (version 7.0.9083)
GetChild(String, DirectoryNode)
Override this method to implement retrieval of DirectoryNode or FileNode
with the specified name
located in the specified parent
directory.
When the virtual file system is used in the FileServer component, the server session, which contains information about the user and the active connection, can be accessed using Current property.
Declaration
protected abstract NodeBase GetChild(string name, DirectoryNode parent)
Parameters
Type | Name | Description |
---|---|---|
String | name | Name of the child node to be returned. |
DirectoryNode | parent | Parent DirectoryNode of the requested child node. |
Returns
Type | Description |
---|---|
NodeBase | A DirectoryNode or a FileNode if the child node exists; or null if it does not exist. |
Examples
protected override NodeBase GetChild(string name, DirectoryNode parent)
{
var fullChildPath = getFullPath(parent.Path.AddPathPart(name));
if (File.Exists(fullChildPath))
{
return new FileNode(name, parent);
}
if (Directory.Exists(fullChildPath))
{
return new DirectoryNode(name, parent);
}
}
return null;