- Namespace
- Statiq
.Testing - Interfaces
- Base Types
-
- object
graph BT
Type-->Base0["object"]
Type-.->Interface0["IFile"]
click Interface0 "/api/Statiq.Common/IFile"
Type-.->Interface1["IFileSystemEntry"]
click Interface1 "/api/Statiq.Common/IFileSystemEntry"
Type-.->Interface2["IDisplayable"]
click Interface2 "/api/Statiq.Common/IDisplayable"
Type-.->Interface3["IContentProviderFactory"]
click Interface3 "/api/Statiq.Common/IContentProviderFactory"
Type-.->Interface4["ICacheCode"]
click Interface4 "/api/Statiq.Common/ICacheCode"
Type["TestFile"]
class Type type-node
Syntax
public class TestFile : IFile, IFileSystemEntry, IDisplayable, IContentProviderFactory, ICacheCode
Constructors
Properties
Name | Property Type | Summary |
---|---|---|
CreationTime | DateTime |
Gets the time when the current entry was created.
|
Directory | IDirectory |
Gets the directory of the file.
|
Exists | bool |
Gets a value indicating whether this
IFileSystemEntry exists.
|
LastWriteTime | DateTime |
Gets the time when the current entry was last written to.
|
Length | long |
Gets the length of the file.
|
MediaType | string |
Gets the media type of the file.
|
Path | NormalizedPath |
Gets the path to the file.
|
Methods
Name | Return Value | Summary |
---|---|---|
Delete |
void |
Deletes the file.
|
GetCacheCodeAsync |
Task |
Gets a deterministic hash appropriate for caching.
|
GetContentProvider |
IContentProvider |
Gets a content provider.
|
GetContentProvider |
IContentProvider |
Gets a content provider with the specified media type.
|
Open |
Stream |
Opens the file for reading and writing. This will either create the file
if it doesn't exist or overwrite it if it does.
|
OpenAppend |
Stream |
Opens the file for writing. This will either create the file
if it doesn't exist or append to it if it does.
|
OpenRead |
Stream |
Opens the file for reading. If it does not exist, an exception will be thrown.
|
OpenText |
TextReader |
Opens the file for reading as text. If it does not exist, an exception will be thrown.
|
OpenWrite |
Stream |
Opens the file for writing. This will either create the file
if it doesn't exist or overwrite it if it does.
You must manually call
System.IO.Stream.SetLength(System.Int64)
when done to ensure previously existing data is truncated.
|
ReadAllBytesAsync |
Task |
Reads all bytes from the file.
|
ReadAllTextAsync |
Task |
Reads all text from the file.
|
Refresh |
void |
Refreshes any cached information about the file.
|
ToDisplayString |
string |
A display string that can be used for tracing.
|
ToString |
string | |
WriteAllBytesAsync |
Task |
Writes the specified bytes to a file.
|
WriteAllTextAsync |
Task |
Writes the specified text to a file.
|