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
ContentPath
Gets the path to the content of the file.
public string ContentPath { get; }
Result Type: string
DirectoryName
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
Extension
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
Hash
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
Info
Gets information about file. <returns>A TagBites.IO.IFileLinkInfo object representing information about a file.</returns>
public IFileLinkInfo Info { get; }
Result Type: IFileLinkInfo
Length
Gets the size, in bytes, of the file.
public long Length { get; }
Result Type: long
NameWithoutExtension
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
Type
public FileSystemLinkType Type { get; }
Result Type: FileSystemLinkType
Methods
GetHistoryVersions()
Retrieves a collection of the file versions.
public IList<FileVersionLink> GetHistoryVersions()
Result Type: IList<FileVersionLink>
GetHistoryVersions(DateTime)
Retrieves a collection of the file versions since specified date time.
public IList<FileVersionLink> GetHistoryVersions(DateTime since)
Result Type: IList<FileVersionLink>
Parameters
Type | Name | |
---|---|---|
DateTime | since | >A since which the file version are retrieving. |
GetHistoryVersionsAsync()
Asynchronously retrieves a collection of the file versions.
public Task<IList<FileVersionLink>> GetHistoryVersionsAsync()
Result Type: Task<IList<FileVersionLink>>
GetHistoryVersionsAsync(DateTime)
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
Type | Name | |
---|---|---|
DateTime | since | >A since which the file version are retrieving. |
GetInfo()
Gets the information about the file.
protected IFileSystemStructureLinkInfo GetInfo()
Result Type: IFileSystemStructureLinkInfo
HasEqualContent(IFileResourceLink)
Returns a value indicating whether the file has equal content to other file/file version.
public bool HasEqualContent(IFileResourceLink other)
Result Type: bool
Parameters
Type | Name | |
---|---|---|
IFileResourceLink | other | The link to the file/file version to compare. |
HasEqualContentAsync(IFileResourceLink)
Asynchronously returns a value indicating whether the file has equal content to other file/file version.
public Task<bool> HasEqualContentAsync(IFileResourceLink other)
Parameters
Type | Name | |
---|---|---|
IFileResourceLink | other | The link to the file/file version to compare. |
Read()
Reads the file.
public Stream Read()
Result Type: Stream
ReadAsync()
Asynchronously reads the file.
public Task<Stream> ReadAsync()
Write(Stream)
Creates or overwrites the file.
public void Write(Stream stream)
Result Type: void
Parameters
Type | Name | |
---|---|---|
Stream | stream | The stream to which the contents of the current file will be written. |
WriteAsync(Stream)
Asynchronously creates or overwrites the file.
public Task WriteAsync(Stream stream)
Result Type: Task
Parameters
Type | Name | |
---|---|---|
Stream | stream | The stream to which the contents of the current file will be written. |