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

ReadWriteFileSystemProvider.GetLength Method

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

GetLength(NodeBase)

Override this method to implement retrieval of the length of the content for the node.

By default, this method is only called for files (instances of the class FileNode). To enable this method for directories (instances of DirectoryNode), add a new instance of FileSystemProviderSettings (with the property EnableGetLengthMethodForDirectories set to true) to the ReadOnlyFileSystemProvider(FileSystemProviderSettings) constructor.

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 long GetLength(NodeBase node)
Parameters
Type Name Description
NodeBase node

Processed node.

Returns
Type Description
Int64

Length of the content for the node.

Examples
protected override long GetLength(NodeBase node)
{
 var fullPath = getFullPath(node.Path);
 return new FileInfo(fullPath).Length;
}
In This Article
  • GetLength(NodeBase)
© REBEX ČR s.r.o. Back to top
Privacy policy
Manage cookies