FileLink

Namespace: TagBites.IO
Assembly: TagBites.IO.dll

Provides a mechanism for linking to the file. This class cannot be inherited.

public sealed class FileLink : TagBites.IO.FileSystemStructureLink, TagBites.IO.IFileResourceLink, TagBites.IO.IFileSystemLink

Properties

Gets the path to the content of the file.

public string ContentPath { get; }

Result Type: string

Gets a string representing the directory's full path. <returns>A System.String representing the directory's full path.</returns>

public string DirectoryName { get; }

Result Type: string

Gets the extension part of the file. <returns>A string containing the the extension part of the file.</returns>

public string Extension { get; }

Result Type: string

Gets the hash value for the file. <returns>A TagBites.IO.FileHash object representing hash value for the file.</returns>

public FileHash Hash { get; }

Result Type: FileHash

Gets information about file. <returns>A TagBites.IO.IFileLinkInfo object representing information about a file.</returns>

public IFileLinkInfo Info { get; }

Result Type: IFileLinkInfo

Gets the size, in bytes, of the file.

public long Length { get; }

Result Type: long

Gets the name without extension part of the file. <returns>A string containing the name without extension part of the file.</returns>

public string NameWithoutExtension { get; }

Result Type: string

public FileSystemLinkType Type { get; }

Result Type: FileSystemLinkType

Methods

Retrieves a collection of the file versions.

public IList<FileVersionLink> GetHistoryVersions()

Result Type: IList<FileVersionLink>

Retrieves a collection of the file versions since specified date time.

public IList<FileVersionLink> GetHistoryVersions(DateTime since)

Result Type: IList<FileVersionLink>

Parameters

TypeName
DateTimesince>A since which the file version are retrieving.

Asynchronously retrieves a collection of the file versions.

public Task<IList<FileVersionLink>> GetHistoryVersionsAsync()

Result Type: Task<IList<FileVersionLink>>

Asynchronously retrieves a collection of the file versions since specified date time.

public Task<IList<FileVersionLink>> GetHistoryVersionsAsync(DateTime since)

Result Type: Task<IList<FileVersionLink>>

Parameters

TypeName
DateTimesince>A since which the file version are retrieving.

Gets the information about the file.

protected IFileSystemStructureLinkInfo GetInfo()

Result Type: IFileSystemStructureLinkInfo

Returns a value indicating whether the file has equal content to other file/file version.

public bool HasEqualContent(IFileResourceLink other)

Result Type: bool

Parameters

TypeName
IFileResourceLinkotherThe link to the file/file version to compare.

Asynchronously returns a value indicating whether the file has equal content to other file/file version.

public Task<bool> HasEqualContentAsync(IFileResourceLink other)

Result Type: Task<bool>

Parameters

TypeName
IFileResourceLinkotherThe link to the file/file version to compare.

Reads the file.

public Stream Read()

Result Type: Stream

Asynchronously reads the file.

public Task<Stream> ReadAsync()

Result Type: Task<Stream>

Creates or overwrites the file.

public void Write(Stream stream)

Result Type: void

Parameters

TypeName
StreamstreamThe stream to which the contents of the current file will be written.

Asynchronously creates or overwrites the file.

public Task WriteAsync(Stream stream)

Result Type: Task

Parameters

TypeName
StreamstreamThe stream to which the contents of the current file will be written.