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

NodeBase Class

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

Provides the base class for both FileNode and DirectoryNode objects.

It is not expected that you inherit from the class NodeBase. Use DirectoryNode or FileNode in your code.

Syntax
public abstract class NodeBase : IEnumerable<NodeBase>, IEnumerable
Inheritance
Object
NodeBase
DirectoryNode
FileNode
Implements
IEnumerable<NodeBase>
IEnumerable
Inherited Members
Object.Equals(Object, Object)
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)

Constructors

Name Description
NodeBase(String, NodeType, DirectoryNode, NodeTimeInfo, NodeAttributes, Boolean)

Initializes a new instance of the NodeBase

Properties

Name Description
Attributes

Gets attributes of the node.

Implementation of the property calls FileSystemProvider methods, therefore repeated consecutive calls of the property can be expensive. Consider storing the value of the property in a local variable.

Context

Gets or sets user-defined object.

Extension

Gets the extension of the node. If the node does not have extension, then returs empty string.

Name = myfile.txt. Extension returns 'txt' (without quotes).

Name = myDirectory. Extension returns empty string.

IsDeleted

Returns true if the node is deleted (does not exist in the file system), otherwise false.

Implementation of the property calls FileSystemProvider methods, therefore repeated consecutive calls of the property can be expensive. Consider storing the value of the property in a local variable.

IsDirectory

Returns true if the current node is DirectoryNode, otherwise returns false.

IsFile

Returns true if the current node is FileNode, otherwise returns false.

IsRootDirectory

Returns true if the current node is root DirectoryNode (node with Path equal to '/'), otherwise returns false.

Length

Gets the length of the content returned by the method GetContent(NodeContentParameters).

Name

Gets the name of the node.

NodeType

Gets the type of the node.

NodeType.File for files.

NodeType.Directory for directories.

Parent

Gets the parent directory of the node.

For the root directory returns null.

Path

Full path of the node.

TimeInfo

Gets the time info of the node.

CreationTime.

AccessTime.

LastWriteTime.

Concrete file system providers are responsible for the correctness and validity of the returned dates.

Implementation of the property calls FileSystemProvider methods, therefore repeated consecutive calls of the property can be expensive. Consider storing the value of the property in a local variable.

Methods

Name Description
CopyTo(DirectoryNode)

Copies the node to the targetNode.

Create()

Creates this node, if it does not exist.

Delete()

Deletes this node.

Equals(NodeBase)

Indicates whether the current NodeBase is equal to another object of the same type.

Equals(Object)

Determines whether the specified obj is equal to this object.

Exists()

Gets a value indicating whether the node exists.

GetChildren()

Gets an enumerator that iterates through the child nodes in the current node.

GetChildren(NodeType)

Gets an enumerator that iterates through the child nodes in the current node. Only nodes whose NodeType matches the requiredType are returned.

GetContent(NodeContentParameters)

Gets the content of the node.

GetEnumerator()

Gets an enumerator that iterates through the child nodes in the current node.

GetHashCode()

Gets a hash code of this object.

GetUnaliasedNode()

Gets the node with real path (relative to FileSystemProvider) in the file system. Both MountCapableFileSystemProvider and FileSystemProvider returned from the method CreateFileSystem() create virtual nodes with virtual (alias) paths. Virtual node "wraps" real node. Use method GetUnaliasedNode to "unwrap" real nodes from virtual nodes.

Calling method GetUnaliasedNode on the already unwrapped node has no effect - method returns this (already unwrapped) instance.

Method GetUnaliasedNode is typically used in the FileSystemNotifier event handlers. Usually you don't need to call this method directly, because virtual (alias) and real nodes in the typical development scenario works as expected.

MoveTo(DirectoryNode)

Moves this node to the newParentNode.

Rename(String)

Renames this node.

SetAttributes(NodeAttributes)

Sets attributes of the node.

SetContent(NodeContent)

Sets a new content of the node. Old content will be deleted!

SetTimeInfo(NodeTimeInfo)

Sets the time info of the node.

ToString()

Returns a string that represents the current NodeBase.

Operators

Name Description
Equality(NodeBase, NodeBase)

Determines whether two specified NodeBase have the same value.

Inequality(NodeBase, NodeBase)

Determines whether two specified NodeBase have different values.

Explicit Interface Implementations

Name Description
IEnumerable.GetEnumerator()

Gets an enumerator that iterates through the child nodes in the current node.

In This Article
  • Constructors
  • Properties
  • Methods
  • Operators
  • Explicit Interface Implementations
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies