Skip to content
Auto
Products

FileLink

Namespace: TagBites.IO
Assembly: TagBites.IO.dll
Product: TagBites.IO v. 2.0.0

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

Inheritance: objectFileSystemStructureLink → FileLink

Gets the path to the content of the file.

public virtual string ContentPath { get; }

string

A string representing the path to the content of the file.

Gets a string representing the directory’s full path.

public string DirectoryName { get; }

string

A String representing the directory’s full path.

Gets the extension part of the file.

public virtual string Extension { get; }

string

A string containing the extension part of the file.

Gets the hash value for the file.

public virtual FileHash Hash { get; }

FileHash

A FileHash object representing hash value for the file.

Gets information about file.

public IFileLinkInfo Info { get; }

IFileLinkInfo

A IFileLinkInfo object representing information about a file.

Gets the size, in bytes, of the file.

public virtual long Length { get; }

long

The size of the file in bytes.

Gets the name without extension part of the file.

public virtual string NameWithoutExtension { get; }

string

A string containing the name without extension part of the file.

public virtual FileSystemLinkType Type { get; }

FileSystemLinkType

Retrieves a collection of the file versions.

public IList<FileVersionLink> GetHistoryVersions()

IList<FileVersionLink>

A collection of strongly typed FileVersionLink objects representing the file versions.

Asynchronously retrieves a collection of the file versions.

public Task<IList<FileVersionLink>> GetHistoryVersionsAsync()

Task<IList<FileVersionLink>>

The task object representing the asynchronous operation. The value of the parameter contains A collection of strongly typed FileVersionLink objects representing the file versions.

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

public virtual bool HasEqualContent(IFileResourceLink other)

bool

true if the file has equal content to other file/file version; otherwise, false.

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

public virtual Task<bool> HasEqualContentAsync(IFileResourceLink other)

Task<bool>

The task object representing the asynchronous operation. The value of the parameter contains a true if the file has equal content to other file/file version; otherwise, false.

Opens direct stream for this file.

public Stream Open(FileAccess mode)

Stream

A direct stream to content.

Asynchronously opens direct stream for this file.

public Task<Stream> OpenAsync(FileAccess mode)

Task<Stream>

The task object representing the asynchronous operation. The value of the parameter contains a direct stream to content.

Opens direct read stream for this file.

public Stream OpenRead()

Stream

A stream to read content directly.

Asynchronously opens direct read stream for this file.

public Task<Stream> OpenReadAsync()

Task<Stream>

The task object representing the asynchronous operation. The value of the parameter contains a read-only Stream on the specified file.

Opens direct read/write stream for this file.

public Stream OpenReadWrite()

Stream

A stream to read/write content directly.

Asynchronously opens direct read/write stream for this file.

public Task<Stream> OpenReadWriteAsync()

Task<Stream>

The task object representing the asynchronous operation. The value of the parameter contains a direct stream to read/write file’s content.

Opens direct write stream for this file.

public Stream OpenWrite(bool overwrite)
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Stream

A stream to write content directly.

Asynchronously opens direct write stream for this file.

public Task<Stream> OpenWriteAsync(bool overwrite)
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Task<Stream>

The task object representing the asynchronous operation. The value of the parameter contains a direct stream to write file’s content.

Reads the file to a stream.

public void Read(Stream stream)

Asynchronously reads the file to a stream.

public Task ReadAsync(Stream stream)

Task

The task object representing the asynchronous operation.

Creates or overwrites the file.

public void Write(Stream stream, bool overwrite)
  • stream Stream
    The stream to which the contents of the current file will be written.
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Asynchronously creates or overwrites the file.

public Task WriteAsync(Stream stream, bool overwrite)
  • stream Stream
    The stream to which the contents of the current file will be written.
  • overwrite bool
    true if the file can be overwritten; otherwise, if the file exists, an exception will be thrown.

Task

The task object representing the asynchronous operation.