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.IFileSystemLinkInheritance: object → FileSystemStructureLink → FileLink
Properties
Section titled “Properties”ContentPath
Section titled “ContentPath”Gets the path to the content of the file.
public virtual string ContentPath { get; }Property Value
Section titled “Property Value”A string representing the path to the content of the file.
DirectoryName
Section titled “DirectoryName”Gets a string representing the directory’s full path.
public string DirectoryName { get; }Property Value
Section titled “Property Value”A String representing the directory’s full path.
Extension
Section titled “Extension”Gets the extension part of the file.
public virtual string Extension { get; }Property Value
Section titled “Property Value”A string containing the extension part of the file.
Gets the hash value for the file.
public virtual FileHash Hash { get; }Property Value
Section titled “Property Value”A FileHash object representing hash value for the file.
Gets information about file.
public IFileLinkInfo Info { get; }Property Value
Section titled “Property Value”A IFileLinkInfo object representing information about a file.
Length
Section titled “Length”Gets the size, in bytes, of the file.
public virtual long Length { get; }Property Value
Section titled “Property Value”The size of the file in bytes.
NameWithoutExtension
Section titled “NameWithoutExtension”Gets the name without extension part of the file.
public virtual string NameWithoutExtension { get; }Property Value
Section titled “Property Value”A string containing the name without extension part of the file.
public virtual FileSystemLinkType Type { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”GetHistoryVersions()
Section titled “GetHistoryVersions()”Retrieves a collection of the file versions.
public IList<FileVersionLink> GetHistoryVersions()Returns
Section titled “Returns”A collection of strongly typed FileVersionLink objects representing the file versions.
GetHistoryVersionsAsync()
Section titled “GetHistoryVersionsAsync()”Asynchronously retrieves a collection of the file versions.
public Task<IList<FileVersionLink>> GetHistoryVersionsAsync()Returns
Section titled “Returns”The task object representing the asynchronous operation. The value of the parameter contains A collection of strongly typed FileVersionLink objects representing the file versions.
HasEqualContent(IFileResourceLink)
Section titled “HasEqualContent(IFileResourceLink)”Returns a value indicating whether the file has equal content to other file/file version.
public virtual bool HasEqualContent(IFileResourceLink other)Parameters
Section titled “Parameters”otherIFileResourceLink
The link to the file/file version to compare.
Returns
Section titled “Returns”true if the file has equal content to other file/file version; otherwise, false.
HasEqualContentAsync(IFileResourceLink)
Section titled “HasEqualContentAsync(IFileResourceLink)”Asynchronously returns a value indicating whether the file has equal content to other file/file version.
public virtual Task<bool> HasEqualContentAsync(IFileResourceLink other)Parameters
Section titled “Parameters”otherIFileResourceLink
The link to the file/file version to compare.
Returns
Section titled “Returns”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.
Open(FileAccess)
Section titled “Open(FileAccess)”Opens direct stream for this file.
public Stream Open(FileAccess mode)Parameters
Section titled “Parameters”modeFileAccess
Returns
Section titled “Returns”A direct stream to content.
OpenAsync(FileAccess)
Section titled “OpenAsync(FileAccess)”Asynchronously opens direct stream for this file.
public Task<Stream> OpenAsync(FileAccess mode)Parameters
Section titled “Parameters”modeFileAccess
Returns
Section titled “Returns”The task object representing the asynchronous operation. The value of the parameter contains a direct stream to content.
OpenRead()
Section titled “OpenRead()”Opens direct read stream for this file.
public Stream OpenRead()Returns
Section titled “Returns”A stream to read content directly.
OpenReadAsync()
Section titled “OpenReadAsync()”Asynchronously opens direct read stream for this file.
public Task<Stream> OpenReadAsync()Returns
Section titled “Returns”The task object representing the asynchronous operation. The value of the parameter contains a read-only Stream on the specified file.
OpenReadWrite()
Section titled “OpenReadWrite()”Opens direct read/write stream for this file.
public Stream OpenReadWrite()Returns
Section titled “Returns”A stream to read/write content directly.
OpenReadWriteAsync()
Section titled “OpenReadWriteAsync()”Asynchronously opens direct read/write stream for this file.
public Task<Stream> OpenReadWriteAsync()Returns
Section titled “Returns”The task object representing the asynchronous operation. The value of the parameter contains a direct stream to read/write file’s content.
OpenWrite(bool)
Section titled “OpenWrite(bool)”Opens direct write stream for this file.
public Stream OpenWrite(bool overwrite)Parameters
Section titled “Parameters”overwritebool
trueif the file can be overwritten; otherwise, if the file exists, an exception will be thrown.
Returns
Section titled “Returns”A stream to write content directly.
OpenWriteAsync(bool)
Section titled “OpenWriteAsync(bool)”Asynchronously opens direct write stream for this file.
public Task<Stream> OpenWriteAsync(bool overwrite)Parameters
Section titled “Parameters”overwritebool
trueif the file can be overwritten; otherwise, if the file exists, an exception will be thrown.
Returns
Section titled “Returns”The task object representing the asynchronous operation. The value of the parameter contains a direct stream to write file’s content.
Read(Stream)
Section titled “Read(Stream)”Reads the file to a stream.
public void Read(Stream stream)Parameters
Section titled “Parameters”streamStream
ReadAsync(Stream)
Section titled “ReadAsync(Stream)”Asynchronously reads the file to a stream.
public Task ReadAsync(Stream stream)Parameters
Section titled “Parameters”streamStream
Returns
Section titled “Returns”The task object representing the asynchronous operation.
Write(Stream, bool)
Section titled “Write(Stream, bool)”Creates or overwrites the file.
public void Write(Stream stream, bool overwrite)Parameters
Section titled “Parameters”streamStream
The stream to which the contents of the current file will be written.overwritebool
trueif the file can be overwritten; otherwise, if the file exists, an exception will be thrown.
WriteAsync(Stream, bool)
Section titled “WriteAsync(Stream, bool)”Asynchronously creates or overwrites the file.
public Task WriteAsync(Stream stream, bool overwrite)Parameters
Section titled “Parameters”streamStream
The stream to which the contents of the current file will be written.overwritebool
trueif the file can be overwritten; otherwise, if the file exists, an exception will be thrown.
Returns
Section titled “Returns”The task object representing the asynchronous operation.