Show / Hide Table of Contents

Class FileSystem

Provides a base for various file system abstractions. FileSystem abstractions are mostly useful for working with components/classes that may need to inter-operate not only with local file system but also with distributed systems like ApacheHDFS, SVN, GIT, or Aum Cluster Big-Transactional File System (BoltFS). NFX library provides compatibility wrapper 'NFX.IO.FileSystem.Local.LocalFileSystem' for access to local machine file system (which is based on this class and is implemented using a traditional System.IO.* set of classes). The FileSystem abstraction supports the following concepts: versioning, transactions, metadata, security; however it does not guarantee that every implementation is capable of providing all of these functions. Query "GeneralCapabilities" and "InstanceCapabilities" to see what functions are supported by a particular instance. This class is not thread-safe unless stated otherwise on method level, however multiple threads are allowed to obtain their own FileSystemSession object via a call to StartSession() which is thread safe

Inheritance
System.Object
DisposableObject
ApplicationComponent
FileSystem
GoogleDriveFileSystem
LocalFileSystem
S3V4FileSystem
SVNFileSystem
Implements
IFileSystemImplementation
IFileSystem
IApplicationComponent
INamed
System.IDisposable
IConfigurable
Inherited Members
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
ApplicationComponent.ComponentDirector
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: NFX.IO.FileSystem
Assembly: NFX.dll
Syntax
public abstract class FileSystem : ApplicationComponent, IFileSystemImplementation, IFileSystem, IApplicationComponent, INamed, IDisposable, IConfigurable

Constructors

FileSystem(String, IConfigSectionNode)

Declaration
protected FileSystem(string name, IConfigSectionNode node = null)
Parameters
Type Name Description
System.String name
IConfigSectionNode node

Fields

CONFIG_AUTO_START_ATTR

Declaration
public const string CONFIG_AUTO_START_ATTR = "auto-start"
Field Value
Type Description
System.String

CONFIG_DEFAULT_SESSION_CONNECT_PARAMS_SECTION

Declaration
public const string CONFIG_DEFAULT_SESSION_CONNECT_PARAMS_SECTION = "default-session-connect-params"
Field Value
Type Description
System.String

CONFIG_FILESYSTEM_SECTION

Declaration
public const string CONFIG_FILESYSTEM_SECTION = "file-system"
Field Value
Type Description
System.String

CONFIG_FILESYSTEMS_SECTION

Declaration
public const string CONFIG_FILESYSTEMS_SECTION = "file-systems"
Field Value
Type Description
System.String

CONFIG_NAME_ATTR

Declaration
public const string CONFIG_NAME_ATTR = "name"
Field Value
Type Description
System.String

m_Name

Declaration
protected readonly string m_Name
Field Value
Type Description
System.String

m_Sessions

Declaration
protected readonly List<FileSystemSession> m_Sessions
Field Value
Type Description
System.Collections.Generic.List<FileSystemSession>

Properties

DefaultSessionConnectParams

Declaration
protected FileSystemSessionConnectParams DefaultSessionConnectParams { get; }
Property Value
Type Description
FileSystemSessionConnectParams

GeneralCapabilities

Returns capabilities for this file system in general

Declaration
public abstract IFileSystemCapabilities GeneralCapabilities { get; }
Property Value
Type Description
IFileSystemCapabilities

InstanceCapabilities

Returns capabilities for this file system instance, that may or may not be the same as GeneralCapabilities

Declaration
public abstract IFileSystemCapabilities InstanceCapabilities { get; }
Property Value
Type Description
IFileSystemCapabilities

Instances

Returns the read-only registry view of file systems currently activated

Declaration
public static IRegistry<FileSystem> Instances { get; }
Property Value
Type Description
IRegistry<FileSystem>

Name

Provides name for file system instance

Declaration
public string Name { get; }
Property Value
Type Description
System.String

Sessions

Returns a list of sessions. This accessor is thread-safe

Declaration
public IEnumerable<FileSystemSession> Sessions { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<FileSystemSession>

Methods

AutoStartSystems()

Automatically starts systems designated in config with auto-start attribute

Declaration
public static void AutoStartSystems()

CombinePaths(String, String[])

Combines two or more path segments joining them using primary file system path separator. This method is thread-safe

Declaration
public virtual string CombinePaths(string first, params string[] others)
Parameters
Type Name Description
System.String first
System.String[] others
Returns
Type Description
System.String

Configure(IConfigSectionNode)

Configures file system. This method is a part of lifecycle management and is intended to be called only by creating thread (not thread-safe)

Declaration
public void Configure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

Destructor()

Declaration
protected override void Destructor()
Overrides
ApplicationComponent.Destructor()

DoBeginTransaction(FileSystemSession)

Override in particular file systems that support transactions to begin transaction in specified session. This method may be called by miltiple threads

Declaration
protected virtual IFileSystemTransactionHandle DoBeginTransaction(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
IFileSystemTransactionHandle

DoBeginTransactionAsync(FileSystemSession)

Async version of DoBeginTransaction(FileSystemSession). This base/default implementation just synchronously calls DoBeginTransaction(FileSystemSession) and returns already completed Task with result returned by DoBeginTransaction(FileSystemSession)

Declaration
protected virtual Task<IFileSystemTransactionHandle> DoBeginTransactionAsync(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
System.Threading.Tasks.Task<IFileSystemTransactionHandle>

DoCheckCanChange(FileSystemSessionItem)

Override in particular file systems to see if item can change, i.e. for file systems that support versioning throw exception if item is in session which "looks" at a sealed/closed version and can not change. This method may be called by miltiple threads

Declaration
protected virtual void DoCheckCanChange(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item

DoCheckCanChangeAsync(FileSystemSessionItem)

Async version of DoCheckCanChange(FileSystemSessionItem). This base/default implementation just synchronously calls DoCheckCanChange(FileSystemSessionItem) and returns already completed Task with result returned by DoCheckCanChange(FileSystemSessionItem)

Declaration
protected virtual Task DoCheckCanChangeAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task

DoCommitTransaction(FileSystemSession)

Override in particular file systems that support transactions to commit transaction in specified session. This method may be called by miltiple threads

Declaration
protected virtual void DoCommitTransaction(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session

DoCommitTransactionAsync(FileSystemSession)

Async version of DoCommitTransaction(FileSystemSession). This base/default implementation just synchronously calls DoCommitTransaction(FileSystemSession) and returns already completed Task with result returned by DoCommitTransaction(FileSystemSession)

Declaration
protected virtual Task DoCommitTransactionAsync(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
System.Threading.Tasks.Task

DoConfigure(IConfigSectionNode)

Override to perform custom configuration

Declaration
protected virtual void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node

DoCreateDirectory(FileSystemDirectory, String)

Override to create a directory. This method may be called by miltiple threads

Declaration
protected abstract FileSystemDirectory DoCreateDirectory(FileSystemDirectory dir, string name)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
Returns
Type Description
FileSystemDirectory

DoCreateDirectoryAsync(FileSystemDirectory, String)

Async version of DoCreateDirectory(FileSystemDirectory, String). This base/default implementation just synchronously calls DoCreateDirectory(FileSystemDirectory, String) and returns already completed Task with result returned by DoCreateDirectory(FileSystemDirectory, String)

Declaration
protected virtual Task<FileSystemDirectory> DoCreateDirectoryAsync(FileSystemDirectory dir, string name)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
Returns
Type Description
System.Threading.Tasks.Task<FileSystemDirectory>

DoCreateFile(FileSystemDirectory, String, Int32)

Override to create a file. This method may be called by miltiple threads

Declaration
protected abstract FileSystemFile DoCreateFile(FileSystemDirectory dir, string name, int size)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
System.Int32 size
Returns
Type Description
FileSystemFile

DoCreateFile(FileSystemDirectory, String, String, Boolean)

Override to create a file from local file. This method may be called by miltiple threads

Declaration
protected abstract FileSystemFile DoCreateFile(FileSystemDirectory dir, string name, string localFile, bool readOnly)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
System.String localFile
System.Boolean readOnly
Returns
Type Description
FileSystemFile

DoCreateFileAsync(FileSystemDirectory, String, Int32)

Async version of DoCreateFile(FileSystemDirectory, String, Int32). This base/default implementation just synchronously calls DoCreateFile(FileSystemDirectory, String, Int32) and returns already completed Task with result returned by DoCreateFile(FileSystemDirectory, String, Int32)

Declaration
protected virtual Task<FileSystemFile> DoCreateFileAsync(FileSystemDirectory dir, string name, int size)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
System.Int32 size
Returns
Type Description
System.Threading.Tasks.Task<FileSystemFile>

DoCreateFileAsync(FileSystemDirectory, String, String, Boolean)

Async version of DoCreateFile(FileSystemDirectory, String, String, Boolean). This base/default implementation just synchronously calls DoCreateFile(FileSystemDirectory, String, String, Boolean) and returns already completed Task with result returned by DoCreateFile(FileSystemDirectory, String, String, Boolean)

Declaration
protected virtual Task<FileSystemFile> DoCreateFileAsync(FileSystemDirectory dir, string name, string localFile, bool readOnly)
Parameters
Type Name Description
FileSystemDirectory dir
System.String name
System.String localFile
System.Boolean readOnly
Returns
Type Description
System.Threading.Tasks.Task<FileSystemFile>

DoDeleteItem(FileSystemSessionItem)

Override to delete item. This method may be called by miltiple threads

Declaration
protected abstract void DoDeleteItem(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item

DoDeleteItemAsync(FileSystemSessionItem)

Async version of DoDeleteItem(FileSystemSessionItem). This base/default implementation just synchronously calls DoDeleteItem(FileSystemSessionItem) and returns already completed Task with result returned by DoDeleteItem(FileSystemSessionItem)

Declaration
protected virtual Task DoDeleteItemAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task

DoDirectoryDeepCopyAsync(FileSystemDirectory, FileSystemDirectory, FileSystemDirectory.DirCopyFlags, Int32, Func<FileSystemSessionItem, Boolean>, Func<FileSystemSessionItem, Boolean>)

Implements asynchronous deep copy of folders where destination folder may belong to a different file system. The specifics of implementation may be dictated by particular file systems, i.e.: asynchronous strategies for getting file lists may depend on the particular system.

Declaration
protected virtual Task DoDirectoryDeepCopyAsync(FileSystemDirectory dirFrom, FileSystemDirectory dirTo, FileSystemDirectory.DirCopyFlags flags = FileSystemDirectory.DirCopyFlags.Directories | FileSystemDirectory.DirCopyFlags.Files | FileSystemDirectory.DirCopyFlags.Security | FileSystemDirectory.DirCopyFlags.Metadata | FileSystemDirectory.DirCopyFlags.Timestamps | FileSystemDirectory.DirCopyFlags.Readonly | FileSystemDirectory.DirCopyFlags.FilesAndDirsOnly | FileSystemDirectory.DirCopyFlags.All, int bufferSize = 65536, Func<FileSystemSessionItem, bool> filter = null, Func<FileSystemSessionItem, bool> cancel = null)
Parameters
Type Name Description
FileSystemDirectory dirFrom
FileSystemDirectory dirTo
FileSystemDirectory.DirCopyFlags flags
System.Int32 bufferSize
System.Func<FileSystemSessionItem, System.Boolean> filter
System.Func<FileSystemSessionItem, System.Boolean> cancel
Returns
Type Description
System.Threading.Tasks.Task

DoFlushAsync(FileSystemStream, CancellationToken)

Declaration
protected virtual Task DoFlushAsync(FileSystemStream stream, CancellationToken cancellationToken)
Parameters
Type Name Description
FileSystemStream stream
System.Threading.CancellationToken cancellationToken
Returns
Type Description
System.Threading.Tasks.Task

DoGetCreationTimestamp(FileSystemSessionItem)

Override to get item creation timestamp. This method may be called by miltiple threads

Declaration
protected abstract DateTime? DoGetCreationTimestamp(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Nullable<System.DateTime>

DoGetCreationUser(FileSystemSessionItem)

Override in particular file systems to get user who created item. This method may be called by miltiple threads

Declaration
protected virtual User DoGetCreationUser(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
User

DoGetCreationUserAsync(FileSystemSessionItem)

Async version of DoGetCreationUser(FileSystemSessionItem). This base/default implementation just synchronously calls DoGetCreationUser(FileSystemSessionItem) and returns already completed Task with result returned by DoGetCreationUser(FileSystemSessionItem)

Declaration
protected virtual Task<User> DoGetCreationUserAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task<User>

DoGetFileNames(FileSystemDirectory, Boolean)

Override to get file names in directory. If directory is null then root is assumed. This method may be called by miltiple threads

Declaration
protected abstract IEnumerable<string> DoGetFileNames(FileSystemDirectory directory, bool recursive)
Parameters
Type Name Description
FileSystemDirectory directory
System.Boolean recursive
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

DoGetFileNamesAsync(FileSystemDirectory, Boolean)

Async version of DoGetFileNames(FileSystemDirectory, Boolean). This base/default implementation just synchronously calls DoGetFileNames(FileSystemDirectory, Boolean) and returns already completed Task with result returned by DoGetFileNames(FileSystemDirectory, Boolean)

Declaration
protected virtual Task<IEnumerable<string>> DoGetFileNamesAsync(FileSystemDirectory directory, bool recursive)
Parameters
Type Name Description
FileSystemDirectory directory
System.Boolean recursive
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

DoGetFileStream(FileSystemFile, Action<FileSystemStream>)

Override to get file stream. This method may be called by miltiple threads

Declaration
protected abstract FileSystemStream DoGetFileStream(FileSystemFile file, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemFile file
System.Action<FileSystemStream> disposeAction
Returns
Type Description
FileSystemStream

DoGetFileStreamAsync(FileSystemFile, Action<FileSystemStream>)

Async version of DoGetFileStream(FileSystemFile, Action<FileSystemStream>). This base/default implementation just synchronously calls DoGetFileStream(FileSystemFile, Action<FileSystemStream>) and returns already completed Task with result returned by DoGetFileStream(FileSystemFile, Action<FileSystemStream>)

Declaration
protected virtual Task<FileSystemStream> DoGetFileStreamAsync(FileSystemFile file, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemFile file
System.Action<FileSystemStream> disposeAction
Returns
Type Description
System.Threading.Tasks.Task<FileSystemStream>

DoGetItemSize(FileSystemSessionItem)

Override to get the byte size of item (directory or file). This method may be called by miltiple threads

Declaration
protected abstract ulong DoGetItemSize(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.UInt64

DoGetItemSizeAsync(FileSystemSessionItem)

Async version of DoGetItemSize(FileSystemSessionItem). This base/default implementation just synchronously calls DoGetItemSize(FileSystemSessionItem) and returns already completed Task with result returned by DoGetItemSize(FileSystemSessionItem)

Declaration
protected virtual Task<ulong> DoGetItemSizeAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task<System.UInt64>

DoGetLastAccessTimestamp(FileSystemSessionItem)

Override to get item last access timestamp. This method may be called by miltiple threads

Declaration
protected abstract DateTime? DoGetLastAccessTimestamp(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Nullable<System.DateTime>

DoGetLastAccessUser(FileSystemSessionItem)

Override in particular file systems to get user who was the last user accessing the item. This method may be called by miltiple threads

Declaration
protected virtual User DoGetLastAccessUser(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
User

DoGetLastAccessUserAsync(FileSystemSessionItem)

Async version of DoGetLastAccessUser(FileSystemSessionItem). This base/default implementation just synchronously calls DoGetLastAccessUser(FileSystemSessionItem) and returns already completed Task with result returned by DoGetLastAccessUser(FileSystemSessionItem)

Declaration
protected virtual Task<User> DoGetLastAccessUserAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task<User>

DoGetLatestVersion(FileSystemSession)

Override in particular file systems that support versioning to get latest version object that this session can work with. This method may be called by miltiple threads

Declaration
protected virtual IFileSystemVersion DoGetLatestVersion(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
IFileSystemVersion

DoGetLatestVersionAsync(FileSystemSession)

Async version of DoGetLatestVersion(FileSystemSession). This base/default implementation just synchronously calls DoGetLatestVersion(FileSystemSession) and returns already completed Task with result returned by DoGetLatestVersion(FileSystemSession)

Declaration
protected virtual Task<IFileSystemVersion> DoGetLatestVersionAsync(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
System.Threading.Tasks.Task<IFileSystemVersion>

DoGetMetadataStream(FileSystemSessionItem, Action<FileSystemStream>)

Override to get metadata stream for item (directory or file). This method may be called by miltiple threads

Declaration
protected abstract FileSystemStream DoGetMetadataStream(FileSystemSessionItem item, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemSessionItem item
System.Action<FileSystemStream> disposeAction
Returns
Type Description
FileSystemStream

DoGetMetadataStreamAsync(FileSystemSessionItem, Action<FileSystemStream>)

Async version of DoGetMetadataStream(FileSystemSessionItem, Action<FileSystemStream>). This base/default implementation just synchronously calls DoGetMetadataStream(FileSystemSessionItem, Action<FileSystemStream>) and returns already completed Task with result returned by DoGetMetadataStream(FileSystemSessionItem, Action<FileSystemStream>)

Declaration
protected virtual Task<FileSystemStream> DoGetMetadataStreamAsync(FileSystemSessionItem item, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemSessionItem item
System.Action<FileSystemStream> disposeAction
Returns
Type Description
System.Threading.Tasks.Task<FileSystemStream>

DoGetModificationTimestamp(FileSystemSessionItem)

Override to get item modification timestamp. This method may be called by miltiple threads

Declaration
protected abstract DateTime? DoGetModificationTimestamp(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Nullable<System.DateTime>

DoGetModificationUser(FileSystemSessionItem)

Override in particular file systems to get user who was the last user modifying the item. This method may be called by miltiple threads

Declaration
protected virtual User DoGetModificationUser(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
User

DoGetModificationUserAsync(FileSystemSessionItem)

Async version of DoGetModificationUser(FileSystemSessionItem). This base/default implementation just synchronously calls DoGetModificationUser(FileSystemSessionItem) and returns already completed Task with result returned by DoGetModificationUser(FileSystemSessionItem)

Declaration
protected virtual Task<User> DoGetModificationUserAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task<User>

DoGetPermissionsStream(FileSystemSessionItem, Action<FileSystemStream>)

Override to get permissions stream for item (directory or file). This method may be called by miltiple threads

Declaration
protected abstract FileSystemStream DoGetPermissionsStream(FileSystemSessionItem item, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemSessionItem item
System.Action<FileSystemStream> disposeAction
Returns
Type Description
FileSystemStream

DoGetPermissionsStreamAsync(FileSystemSessionItem, Action<FileSystemStream>)

Async version of DoGetPermissionsStream(FileSystemSessionItem, Action<FileSystemStream>). This base/default implementation just synchronously calls DoGetPermissionsStream(FileSystemSessionItem, Action<FileSystemStream>) and returns already completed Task with result returned by DoGetPermissionsStream(FileSystemSessionItem, Action<FileSystemStream>)

Declaration
protected virtual Task<FileSystemStream> DoGetPermissionsStreamAsync(FileSystemSessionItem item, Action<FileSystemStream> disposeAction)
Parameters
Type Name Description
FileSystemSessionItem item
System.Action<FileSystemStream> disposeAction
Returns
Type Description
System.Threading.Tasks.Task<FileSystemStream>

DoGetReadOnly(FileSystemSessionItem)

Override to get item readonly status. This method may be called by miltiple threads

Declaration
protected abstract bool DoGetReadOnly(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Boolean

DoGetSubDirectoryNames(FileSystemDirectory, Boolean)

Override to get subdirectory names of directory. If directory is null then root is assumed. This method may be called by miltiple threads

Declaration
protected abstract IEnumerable<string> DoGetSubDirectoryNames(FileSystemDirectory directory, bool recursive)
Parameters
Type Name Description
FileSystemDirectory directory
System.Boolean recursive
Returns
Type Description
System.Collections.Generic.IEnumerable<System.String>

DoGetSubDirectoryNamesAsync(FileSystemDirectory, Boolean)

Async version of DoGetSubDirectoryNames(FileSystemDirectory, Boolean). This base/default implementation just synchronously calls DoGetSubDirectoryNames(FileSystemDirectory, Boolean) and returns already completed Task with result returned by DoGetSubDirectoryNames(FileSystemDirectory, Boolean)

Declaration
protected virtual Task<IEnumerable<string>> DoGetSubDirectoryNamesAsync(FileSystemDirectory directory, bool recursive)
Parameters
Type Name Description
FileSystemDirectory directory
System.Boolean recursive
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<System.String>>

DoGetVersion(FileSystemSession)

Override in particular file systems that support versioning to get version object for session. This method may be called by miltiple threads

Declaration
protected virtual IFileSystemVersion DoGetVersion(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
IFileSystemVersion

DoGetVersionAsync(FileSystemSession)

Async version of DoGetVersion(FileSystemSession). This base/default implementation just synchronously calls DoGetVersion(FileSystemSession) and returns already completed Task with result returned by DoGetVersion(FileSystemSession)

Declaration
protected virtual Task<IFileSystemVersion> DoGetVersionAsync(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
System.Threading.Tasks.Task<IFileSystemVersion>

DoNavigate(FileSystemSession, String)

Override to get file or directory from specified path. Return null if item does not exist. This method may be called by miltiple threads

Declaration
protected abstract FileSystemSessionItem DoNavigate(FileSystemSession session, string path)
Parameters
Type Name Description
FileSystemSession session
System.String path
Returns
Type Description
FileSystemSessionItem

DoNavigateAsync(FileSystemSession, String)

Async version of DoNavigate(FileSystemSession, String). This base/default implementation just synchronously calls DoNavigate(FileSystemSession, String) and returns already completed Task with result returned by DoNavigate(FileSystemSession, String)

Declaration
protected virtual Task<FileSystemSessionItem> DoNavigateAsync(FileSystemSession session, string path)
Parameters
Type Name Description
FileSystemSession session
System.String path
Returns
Type Description
System.Threading.Tasks.Task<FileSystemSessionItem>

DoReadAsync(FileSystemStream, Byte[], Int32, Int32, CancellationToken)

Declaration
protected virtual Task<int> DoReadAsync(FileSystemStream stream, byte[] buffer, int offset, int count, CancellationToken ct)
Parameters
Type Name Description
FileSystemStream stream
System.Byte[] buffer
System.Int32 offset
System.Int32 count
System.Threading.CancellationToken ct
Returns
Type Description
System.Threading.Tasks.Task<System.Int32>

DoRefresh(FileSystemSessionItem)

Override to refresh item state, i.e. re-fetch remote information. This method may be called by miltiple threads

Declaration
protected virtual void DoRefresh(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item

DoRefreshAsync(FileSystemSessionItem)

Async version of DoRefreshAsync(FileSystemSessionItem). This base/default implementation just synchronously calls DoRefreshAsync(FileSystemSessionItem) and returns already completed Task with result returned by DoRefreshAsync(FileSystemSessionItem)

Declaration
protected virtual Task DoRefreshAsync(FileSystemSessionItem item)
Parameters
Type Name Description
FileSystemSessionItem item
Returns
Type Description
System.Threading.Tasks.Task

DoRenameItem(FileSystemSessionItem, String)

Override to rename item return true on success. This method may be called by miltiple threads

Declaration
protected abstract bool DoRenameItem(FileSystemSessionItem item, string newName)
Parameters
Type Name Description
FileSystemSessionItem item
System.String newName
Returns
Type Description
System.Boolean

DoRenameItemAsync(FileSystemSessionItem, String)

Async version of DoRenameItem(FileSystemSessionItem, String). This base/default implementation just synchronously calls DoRenameItem(FileSystemSessionItem, String) and returns already completed Task with result returned by DoRenameItem(FileSystemSessionItem, String)

Declaration
protected virtual Task<bool> DoRenameItemAsync(FileSystemSessionItem item, string newName)
Parameters
Type Name Description
FileSystemSessionItem item
System.String newName
Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

DoRollbackTransaction(FileSystemSession)

Override in particular file systems that support transactions to rollback transaction in specified session. This method may be called by miltiple threads

Declaration
protected virtual void DoRollbackTransaction(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session

DoRollbackTransactionAsync(FileSystemSession)

Async version of DoRollbackTransaction(FileSystemSession). This base/default implementation just synchronously calls DoRollbackTransaction(FileSystemSession) and returns already completed Task with result returned by DoRollbackTransaction(FileSystemSession)

Declaration
protected virtual Task DoRollbackTransactionAsync(FileSystemSession session)
Parameters
Type Name Description
FileSystemSession session
Returns
Type Description
System.Threading.Tasks.Task

DoSetCreationTimestamp(FileSystemSessionItem, DateTime)

Override to set item creation timestamp. This method may be called by miltiple threads

Declaration
protected abstract void DoSetCreationTimestamp(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp

DoSetCreationTimestampAsync(FileSystemSessionItem, DateTime)

Async version of DoSetCreationTimestamp(FileSystemSessionItem, DateTime). This base/default implementation just synchronously calls DoSetCreationTimestamp(FileSystemSessionItem, DateTime) and returns already completed Task with result returned by DoSetCreationTimestamp(FileSystemSessionItem, DateTime)

Declaration
protected virtual Task DoSetCreationTimestampAsync(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp
Returns
Type Description
System.Threading.Tasks.Task

DoSetLastAccessTimestamp(FileSystemSessionItem, DateTime)

Override to set item last access timestamp. This method may be called by miltiple threads

Declaration
protected abstract void DoSetLastAccessTimestamp(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp

DoSetLastAccessTimestampAsync(FileSystemSessionItem, DateTime)

Async version of DoSetLastAccessTimestamp(FileSystemSessionItem, DateTime). This base/default implementation just synchronously calls DoSetLastAccessTimestamp(FileSystemSessionItem, DateTime) and returns already completed Task with result returned by DoSetLastAccessTimestamp(FileSystemSessionItem, DateTime)

Declaration
protected virtual Task DoSetLastAccessTimestampAsync(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp
Returns
Type Description
System.Threading.Tasks.Task

DoSetModificationTimestamp(FileSystemSessionItem, DateTime)

Override to set item modification timestamp. This method may be called by miltiple threads

Declaration
protected abstract void DoSetModificationTimestamp(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp

DoSetModificationTimestampAsync(FileSystemSessionItem, DateTime)

Async version of DoSetModificationTimestamp(FileSystemSessionItem, DateTime). This base/default implementation just synchronously calls DoSetModificationTimestamp(FileSystemSessionItem, DateTime) and returns already completed Task with result returned by DoSetModificationTimestamp(FileSystemSessionItem, DateTime)

Declaration
protected virtual Task DoSetModificationTimestampAsync(FileSystemSessionItem item, DateTime timestamp)
Parameters
Type Name Description
FileSystemSessionItem item
System.DateTime timestamp
Returns
Type Description
System.Threading.Tasks.Task

DoSetReadOnly(FileSystemSessionItem, Boolean)

Override to set item readonly status. This method may be called by miltiple threads

Declaration
protected abstract void DoSetReadOnly(FileSystemSessionItem item, bool readOnly)
Parameters
Type Name Description
FileSystemSessionItem item
System.Boolean readOnly

DoSetReadOnlyAsync(FileSystemSessionItem, Boolean)

Async version of DoSetReadOnly(FileSystemSessionItem, Boolean). This base/default implementation just synchronously calls DoSetReadOnly(FileSystemSessionItem, Boolean) and returns already completed Task with result returned by DoSetReadOnly(FileSystemSessionItem, Boolean)

Declaration
protected virtual Task DoSetReadOnlyAsync(FileSystemSessionItem item, bool readOnly)
Parameters
Type Name Description
FileSystemSessionItem item
System.Boolean readOnly
Returns
Type Description
System.Threading.Tasks.Task

DoSetVersion(FileSystemSession, IFileSystemVersion)

Override in particular file systems that support versioning to set seesion to specific version. This method may be called by miltiple threads

Declaration
protected virtual void DoSetVersion(FileSystemSession session, IFileSystemVersion version)
Parameters
Type Name Description
FileSystemSession session
IFileSystemVersion version

DoSetVersionAsync(FileSystemSession, IFileSystemVersion)

Async version of DoSetVersion(FileSystemSession, IFileSystemVersion). This base/default implementation just synchronously calls DoSetVersion(FileSystemSession, IFileSystemVersion) and returns already completed Task with result returned by DoSetVersion(FileSystemSession, IFileSystemVersion)

Declaration
protected virtual Task DoSetVersionAsync(FileSystemSession session, IFileSystemVersion version)
Parameters
Type Name Description
FileSystemSession session
IFileSystemVersion version
Returns
Type Description
System.Threading.Tasks.Task

DoWriteAsync(FileSystemStream, Byte[], Int32, Int32, CancellationToken)

Declaration
protected virtual Task DoWriteAsync(FileSystemStream stream, byte[] buffer, int offset, int count, CancellationToken ct)
Parameters
Type Name Description
FileSystemStream stream
System.Byte[] buffer
System.Int32 offset
System.Int32 count
System.Threading.CancellationToken ct
Returns
Type Description
System.Threading.Tasks.Task

Make<TParam>(IConfigSectionNode)

Declaration
public static TParam Make<TParam>(IConfigSectionNode node)where TParam : FileSystem
Parameters
Type Name Description
IConfigSectionNode node
Returns
Type Description
TParam
Type Parameters
Name Description
TParam

Make<TParam>(String, String)

Declaration
public static TParam Make<TParam>(string cfgStr, string format = "laconf")where TParam : FileSystem
Parameters
Type Name Description
System.String cfgStr
System.String format
Returns
Type Description
TParam
Type Parameters
Name Description
TParam

MakeSessionConfigParams(IConfigSectionNode)

Declaration
protected virtual FileSystemSessionConnectParams MakeSessionConfigParams(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Returns
Type Description
FileSystemSessionConnectParams

StartSession(FileSystemSessionConnectParams)

Creates a new session for the user. This method is thread-safe, however the returned FileSystemSession object is not. Every thread must obtain its own session via this method

Declaration
public abstract FileSystemSession StartSession(FileSystemSessionConnectParams cParams = null)
Parameters
Type Name Description
FileSystemSessionConnectParams cParams
Returns
Type Description
FileSystemSession

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

Implements

IFileSystemImplementation
IFileSystem
IApplicationComponent
INamed
System.IDisposable
IConfigurable

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX