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

ReadOnlyFileSystemProvider.Exists Method

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

Exists(NodePath, NodeType)

Override this method to implement verification of existence of a FileNode or DirectoryNode.

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 bool Exists(NodePath path, NodeType nodeType)
Parameters
Type Name Description
NodePath path

NodePath to be verified.

NodeType nodeType

Required NodeType of the NodeBase.

Returns
Type Description
Boolean

True if the NodeBase can be found in the path and its NodeType matches nodeType, otherwise false.

Examples
protected override bool Exists(NodePath path, NodeType nodeType)
{
 var fullPath = getFullPath(path);
 if (nodeType == NodeType.File)
 {
   return File.Exists(fullPath);
 }

 if (nodeType == NodeType.Directory)
 {
   return Directory.Exists(fullPath);
 }

 return false;
}
In This Article
  • Exists(NodePath, NodeType)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies