Class FileSystemSessionItem
Represents an abstraction for items kept in a file system - i.e. directories and files.This class is NOT thread-safe
Inheritance
System.Object
FileSystemSessionItem
Implements
System.IDisposable
Inherited Members
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)
Assembly: NFX.dll
Syntax
public abstract class FileSystemSessionItem : DisposableObject, IDisposable, INamed
Constructors
FileSystemSessionItem(FileSystemSession, String, String, IFileSystemHandle)
Declaration
protected FileSystemSessionItem(FileSystemSession session, string parentPath, string name, IFileSystemHandle handle)
Parameters
Fields
m_FileSystem
Declaration
protected readonly FileSystem m_FileSystem
Field Value
m_Handle
Declaration
protected readonly IFileSystemHandle m_Handle
Field Value
m_Modified
Declaration
protected bool m_Modified
Field Value
| Type |
Description |
| System.Boolean |
|
m_Session
Declaration
protected readonly FileSystemSession m_Session
Field Value
Properties
CreationTimestamp
Gets/sets UTC creation timestamp
Declaration
public DateTime? CreationTimestamp { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.DateTime> |
|
CreationUser
Gets the user who created this item
Declaration
public User CreationUser { get; }
Property Value
FileSystem
Returns filesystem - this is a shortcut to Session.FileSystem
Declaration
public FileSystem FileSystem { get; }
Property Value
Handle
Returns file system handle for this entity
Declaration
public IFileSystemHandle Handle { get; }
Property Value
IsReadOnly
Indicates whether this item can change and file system supports modifications
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
LastAccessTimestamp
Gets/sets UTC last access timestamp
Declaration
public DateTime? LastAccessTimestamp { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.DateTime> |
|
LastAccessUser
Gets the last user who accessed the item
Declaration
public User LastAccessUser { get; }
Property Value
Returns item metadata stream
Declaration
public FileSystemStream MetadataStream { get; }
Property Value
ModificationTimestamp
Gets/sets UTC modification timestamp
Declaration
public DateTime? ModificationTimestamp { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.DateTime> |
|
ModificationUser
Gets the user who modified this item
Declaration
public User ModificationUser { get; }
Property Value
Modified
Indicates whether anything has changed since last transaction has started
Declaration
public bool Modified { get; }
Property Value
| Type |
Description |
| System.Boolean |
|
Name
Declaration
public string Name { get; set; }
Property Value
| Type |
Description |
| System.String |
|
ParentPath
Returns path to directory that contains this item
Declaration
public string ParentPath { get; }
Property Value
| Type |
Description |
| System.String |
|
Path
Returns an absolute path for this item
Declaration
public string Path { get; }
Property Value
| Type |
Description |
| System.String |
|
PermissionsStream
Returns item permissions stream
Declaration
public FileSystemStream PermissionsStream { get; }
Property Value
ReadOnly
Gets/sets readonly attribute
Declaration
public bool ReadOnly { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Session
Returns session through which this object was obtained
Declaration
public FileSystemSession Session { get; }
Property Value
Size
Returns the byte size of the item, depending on implementation this property may return approximate sizes for files and directories
(i.e in distributed systems)
Declaration
public ulong Size { get; }
Property Value
| Type |
Description |
| System.UInt64 |
|
Methods
CheckCanChange()
Throws when item can not change
Declaration
public void CheckCanChange()
CheckCanChangeAsync()
Declaration
public Task CheckCanChangeAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Delete()
Deletes this item from file system
Declaration
DeleteAsync()
Declaration
public Task DeleteAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Destructor()
Declaration
protected override void Destructor()
Overrides
GetCreationUserAsync()
Async version of CreationUser
Declaration
public Task<User> GetCreationUserAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task<User> |
|
GetLastAccessUserAsync()
Async version of LastAccessUser
Declaration
public Task<User> GetLastAccessUserAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task<User> |
|
GetModificationUserAsync()
Async version of ModificationUser
Declaration
public Task<User> GetModificationUserAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task<User> |
|
GetSizeAsync()
Declaration
public Task<ulong> GetSizeAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task<System.UInt64> |
|
Refresh()
Refreshes the state represented by this item, i.e. this may re-read attributes from remote file system
Declaration
RefreshAsync()
Declaration
public Task RefreshAsync()
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
Rename(String)
Renames an item. Check file system capabilities to see if renaming is supported
Declaration
public void Rename(string newName)
Parameters
| Type |
Name |
Description |
| System.String |
newName |
|
RenameAsync(String)
Declaration
public Task RenameAsync(string newName)
Parameters
| Type |
Name |
Description |
| System.String |
newName |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
SetCreationTimestampAsync(DateTime)
Async version of CreationTimestamp
Declaration
public Task SetCreationTimestampAsync(DateTime timestamp)
Parameters
| Type |
Name |
Description |
| System.DateTime |
timestamp |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
SetLastAccessTimestampAsync(DateTime)
Async version of LastAccessTimestamp
Declaration
public Task SetLastAccessTimestampAsync(DateTime timestamp)
Parameters
| Type |
Name |
Description |
| System.DateTime |
timestamp |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
SetModificationTimestampAsync(DateTime)
Async version of ModificationTimestamp
Declaration
public Task SetModificationTimestampAsync(DateTime timestamp)
Parameters
| Type |
Name |
Description |
| System.DateTime |
timestamp |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
SetReadOnlyAsync(Boolean)
Async version of ReadOnly
Declaration
public Task SetReadOnlyAsync(bool readOnly)
Parameters
| Type |
Name |
Description |
| System.Boolean |
readOnly |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
|
ToString()
Declaration
public override string ToString()
Returns
| Type |
Description |
| System.String |
|
Overrides
System.Object.ToString()
Implements
System.IDisposable
Extension Methods