Rebex
Products Downloads Buy Support Contact
Show / Hide Table of Contents

ReadWriteFileSystemProvider.GetChild Method

Namespace: Rebex.IO.FileSystem
Assembly: Rebex.FileSystem.dll (version 7.0.9147)

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.

Inherited from ReadOnlyFileSystemProvider.
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;
In This Article
  • GetChild(String, DirectoryNode)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies